MardukLitzer
asked on
RegEnumValue and LPBYTE type
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[1000];
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
LPBYTE storeRegValue = NULL;
storeRegValue = new BYTE[1000];
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well, simillar in RegEnumValue
ASKER
Thanks all for your clarifications! I'm still trying to get used to the WINDOWS DATATYPES :)