RegEnumValue and LPBYTE type
Posted on 2007-11-19
Hello, I'm trying to return a value from a registry key and am having issues with the LPBYTE datatype.
LPBYTE storeRegValue = NULL;
storeRegValue = new BYTE;
retCode = RegEnumValue(hKey, i, str, &cchValue, 0, (LPDWORD)REG_SZ, (LPBYTE)storeRegValue, (LPDWORD)MAX_VALUE_NAME);
When I debug this, it gives me Bad Ptr errors even after initializing. The RegEnumValue is crashing the app with an "Cannot Read Memory Location Error". Any ideas? I've searched on the web and the code is declared and initialized in much the same way as I have done. Any help pointing out what I've missed would be great! Thanks in advance