SECRegistry::Connect

BOOLSECRegistry::Connect(HKEYhKeyToOpen, LPCTSTRlpszComputerName)

Establishes a connection with the registry.

Defined in: SECREG.CPP

Return Value

Nonzero if a connection to the key was established, otherwise 0.

Parameters

hKeyToOpen

The handle of the registry key to connect to.

lpszComputerName

Name of the computer to connect to.

Comments

This method is called as the first step in accessing the registry. It connects to an existing key in the registry on the local or remote computer named by lpszComputerName. If lpszComputerName is NULL or contains an empty string, the local system is assumed.

Once a connection to the registry is established, use the  Open method to open keys in the registry.

Example

SECRegistry reg;
BOOL rc = reg.Connect(HKEY_LOCAL_MACHINE, "RemoteSystemName");

Developer Notes

32-bit only. Also, if connecting to a remote registry, and the name of the remote system cannot be found, this method will not return until a time-out occurs.

See Also

SECRegistry  Open  Close