|
-
April 27th, 2001, 10:08 AM
#1
RegEnumKeyEx Error 87
I keep getting the error "87 Parameter is incorrect" when calling the RegEnumKeyEx API call.
My declaration is:
private Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (byval hKey as Long, byval dwIndex as Long, byval lpName as string, lpcbName as Long, lpReserved as Long, byval lpClass as string, lpcbClass as Long, lpftLastWriteTime as Long) as Long
and the use is:
'\\ Initialise the string that are going to hold the values...
lKeyLen = 2000
lClassLen = 2000
sKeyName = string$(lKeyLen, 0)
sClassName = string$(lClassLen, 0)
'\\ Enumerate through the keys adding each one...
While lRet = 0
lRet = RegEnumKeyEx(Key, lIndex, sKeyName, lKeyLen, lReserved, sClassName, lClassLen, lpftLastWriteTime)
lIndex = lIndex + 1
Wend
Any ideas?
TIA,
Duncan
I have checked that Key is a valid open key
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
April 27th, 2001, 04:51 PM
#2
Re: RegEnumKeyEx Error 87
Your Last parameter on the declaration is wrong. here is the correct declaration
public Type FILETIME
dwLowDateTime as Long
dwHighDateTime as Long
End Type
Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" _
(byval hKey as Long, byval dwIndex as Long, _
byval lpname as string, lpcbName as Long, _
byval lpReserved as Long, _
byval lpClass as string, _
lpcbClass as Long, _
lpftLastWriteTime as FILETIME) as Long
John G
-
April 30th, 2001, 02:50 AM
#3
Re: RegEnumKeyEx Error 87
Full marks - That was precisely it.
Thanks,
D.
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|