Clearcode
April 27th, 2001, 10:08 AM
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
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