Link to home
Start Free TrialLog in
Avatar of arvind_cs
arvind_cs

asked on

Registry

How can I read Key-value pairs from the registry of a remote computer? I have tried using RegConnectRegistry but the subsequent call to RegQueryValueEx gives 'file not found (error no. 2)' error. How can I solve this problem?

Here's the code that I tried:


l_Ret = RegConnectRegistry(CompName, HKEY_LOCAL_MACHINE, &phKey);         
LPCTSTR =
lpValueName  "SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\NtServicePack\\EventMessageFile";                        
l_Ret = RegQueryValueEx(phKey,lpValueName, NULL, NULL,lpData,  &dSize);

RegCloseKey(phKey);
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial