May 10, 2012 at 3:45am UTC
I revised the question to provide a little more information.
This call is used to open the Registry Key:
HKEY hKey;
LPCTSTR CFDW_Reg_Key = TEXT("SOFTWARE\\Company A\\Application_Name\\1.13");
result = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
CFDW_Reg_Key,
NULL,
KEY_READ | KEY_WRITE,
&hKey);
The following call works on a Windows XP computer, but returns an error code=2 on my Windows 7 computer.
HKEY hKey;
DWORD buflen;
LPCWSTR REG_INSTALL_PATH_NAME = TEXT("InstallPath");
result = RegQueryValueEx(hKey, REG_INSTALL_PATH_NAME, 0, 0, 0, &buflen);
Any help would be greatly appreciated.
Thank you.
Scott
Last edited on May 10, 2012 at 4:21am UTC
May 10, 2012 at 5:13am UTC
Error code 2 is file not found, I think. Have you verified that the key value exists? If you are running the code as 32-bit in a 64-bit PC, have you taken into account registry reflection?