Hello,
I m developing a tool in VC++ which fetches system information for Windows 7: Here is the sample code snippet:
CRegKey key;
if(ERROR_SUCCESS == key.Open(hKey, pPath, KEY_READ))
{
// read the value, length will contain the size after the call
if (ERROR_SUCCESS != key.QueryBinaryValue(pValueName, pData, &length))
{
// error occurred
length = 0;
}
key.Close();
}
else
{
length = 0;
}
length returned is 0. :( QueryBinaryValue() method which tries to read REG_BINARY key from registry is not working properly for windows 7 and thowing error code as 2( key not found). The same code works well for XP, Vista.
waiting for the quick reply. Thanks in advance.