Link to home
Start Free TrialLog in
Avatar of MardukLitzer
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
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, simillar in RegEnumValue
Avatar of MardukLitzer
MardukLitzer

ASKER

Thanks all for your clarifications! I'm still trying to get used to the WINDOWS DATATYPES :)