Link to home
Start Free TrialLog in
Avatar of vgandhi2003
vgandhi2003

asked on

Cant read registry entry in MFC using studio.net

I am using the following function
     RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentSet\\WebServices\\Netlogon", 0,KEY_READ, &hKey) == ERROR_SUCCESS)
to open the key.
This function returns SUCCESS indicating that it has opened the key. However when I try to read one of the values under this key by using the following function

DWORD DataType ; DWORD DataSize;DWORD lpData;
::RegQueryValueExW(hKey, KEYNAME, NULL, &DataType, ( LPBYTE )&lpData, &DataSize);              

it does nothing the value in lpData remains zero where as the value should be 2.

Any ideas to what might be going wrong.
ASKER CERTIFIED SOLUTION
Avatar of Priyesh
Priyesh

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