I am completly stumped
Any one explain why this does not work
This function
Public Function QueryKey(hKey As Long, subkey As String, keyname As String) As String
Dim lhandle As Long
Dim lpType As String
Dim rc As Long
lpType = String(1024, 0)
If Not RegOpenKeyEx(hKey, subkey, 0, KEY_ALL_ACCESS, lhandle) Then
If Not RegQueryValueEx(lhandle, keyname, 0, REG_SZ, lpType, 1024) Then
QueryKey = Left$(lpType, InStr(1, lpType, "0") - 1)
Else
QueryKey = ""
End If
Else
QueryKey = ""
End If
If lhandle <> 0 Then RegCloseKey lhandle
End Function
is called as follows
ret = QueryKey(HKEY_CURRENT_USER, "Software\company\product", "keydesired")
I have checked and the relevant values exist in the registry. The open key portion sees to go without a hitch
Debugging is the process of removing bugs. Programming is the process of putting them in
Any one explain why this does not work
This function
Public Function QueryKey(hKey As Long, subkey As String, keyname As String) As String
Dim lhandle As Long
Dim lpType As String
Dim rc As Long
lpType = String(1024, 0)
If Not RegOpenKeyEx(hKey, subkey, 0, KEY_ALL_ACCESS, lhandle) Then
If Not RegQueryValueEx(lhandle, keyname, 0, REG_SZ, lpType, 1024) Then
QueryKey = Left$(lpType, InStr(1, lpType, "0") - 1)
Else
QueryKey = ""
End If
Else
QueryKey = ""
End If
If lhandle <> 0 Then RegCloseKey lhandle
End Function
is called as follows
ret = QueryKey(HKEY_CURRENT_USER, "Software\company\product", "keydesired")
I have checked and the relevant values exist in the registry. The open key portion sees to go without a hitch
Debugging is the process of removing bugs. Programming is the process of putting them in