The following code worked on Windows 7 but returns rc = 2 on Windows 8:
static const wchar_t *pKeyAppName = L"SOFTWARE\\GA\\Xript";
:
.
{
DWORD value = 0, size = 4;
LONG rc = RegGetValue(HKEY_LOCAL_MACHINE,pKeyAppName,L"w",RRF_RT_REG_DWORD,NULL,&wTablet,&size);
if (rc != ERROR_SUCCESS)
{
log_evt(EVENTLOG_ERROR_TYPE,MSG_REGISTRY_RW,5,L"read",L"w",L"HKLM",pKeyAppName,log_2Str(fDec,rc));
return false;
}
}
Yes, I have checked several times (with regedit) the key
HKEY_LOCAL_MACHINE\SOFTWARE\GA\Xript exists and has a REG_DWORD type field called simply "w" (without the quotes).
What is wrong, was sg. changed?
I've tried to open the key and then read the value via the returned HKEY - the open delivered the same rc=2.
Can anyone help to fix this please?
Many thanks in advance.
Kara