Quantcast
Channel: Windows 7 Miscellaneous forum
Viewing all articles
Browse latest Browse all 11372

RegGetValue Can't find the entry (RC=2)

$
0
0

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


Viewing all articles
Browse latest Browse all 11372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>