You shouldn't just output rgValue, it is binary data unless Type has a value of REG_EXPAND_SZ, REG_MULTI_SZ, REG_SZ.
If the value in the registry is really a DWORD then Type should be REG_DWORD and size1 should be 4 on exit. In that case something (non-portable) like
DWORD dwValue = *((DWORD*)rgValue);
should do the trick. Alternatively just pass a pointer to a DWORD into RegQueryValueEx in the first place if you are sure of the type the key holds. RTFM: RegQueryValueEx
Banfa
Practically a Master Poster
600 posts since Mar 2010
Reputation Points: 486
Solved Threads: 92