RegQueryValueEx返回ERROR_SUCCESS,但读取的值(DWORD)始终为0,而实际上在注册表中为非零。下面是我正在查询的带有突出显示的注册表项的图像。
请帮助解决此问题。我如何获得正确的价值。下面是用于查询值的代码段。
HKEY hKey;
DWORD dwVal;
DWORD dwCount = sizeof(DWORD);
CString strPathMPSettings = "SOFTWARE\\Novellus Systems\\Proteus\\" + strGrpName + "\\" + strUserName + "\\MyProteusSettings";
if(RegOpenKeyEx( HKEY_CURRENT_USER, strPathMPSettings, 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS)
{
if(RegQueryValueEx(hKey, "USER_SETTINGS", NULL, NULL, (LPBYTE)&dwVal, &dwCount) == ERROR_SUCCESS)
{
//Code statements in this section is executed.
}
}