Posted on 1998-12-02
I'm trying to change a registry key in a remote machine's HKEY_LOCAL_MACHINE branch using RegConnectRegistry(). Everything's set up okay - both machines are NT4 servers (SP3) and Administrator account is set up so that it has full control over both machine A and machine B and full access to both registries.
Here's my code:
LPTSTR lpMachineName; // address of name of remote computer
lpMachineName = "\\SEURD01WEB002";
HKEY hKey; // predefined registry handle
hKey = HKEY_LOCAL_MACHINE;
PHKEY phkResult; // address of buffer for remote registry handle
diditwork = 0;
diditwork = RegConnectRegistry(
if (diditwork != ERROR_SUCCESS)
MessageBox ("Remote connection failed");
Can you guys see anything wrong with this code ? I've performed the connection manually using regedt32 and connecting to the machine name and the branch - it works fine...
...so please, save me from going crazy and tell me what I'm doing wrong ! Thanks a lot,