Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegEnumValue API--can't get consistent behavior

Status
Not open for further replies.

LiquidSchwarz

Programmer
Joined
Apr 24, 2003
Messages
9
Location
US
I am trying to get registry values using RegEnumValue API. I am not getting consistent results.

Private Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" ( _
ByVal hKey As Long, _
ByVal dwIndex As Long, _
ByVal lpValueName As String, _
lpcbValueName As Long, _
ByVal lpReserved As Long, _
lpType As Long, _
lpData As Any, _
lpcbData As Long) _
As Long


The example I found at AllAPI.net does not seem to work properly. It seems to skip values even though there is nonzero data in those values.

When enumerating values for a test key, I am getting fatal errors if I use anything but a null value for the argument lpData.

I would include more code, but I have tried so many things I don't know where to begin.

TIA
 
The answer.....

Use RegOpenEx instead of RegOpen.

No more crashes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top