Hi all
I am using someone else's code. When I encountered the line
lRetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "RegistryLoc",0,_ KEY_ALL_ACCESS, hKey)
it came up with an error saying method or data member not defined. I did a search and found that this RegOpenKeyEx is an API for accessing the Registry. I copied and pasted the following code from MSDN into my project:
Declare Function RegOpenKeyEx Lib "advapi32" Alias _
"RegOpenKeyExA" (ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, _
phkResult As Long) As Long
Now when I run it, it comes up with an error where I pass the API HKEY_LOCAL_MACHINE saying variable not defined.
If I put HKEY_LOCAL_MACHINE in quotes, the program generates an error.
What am I doing wrong?? Any advice, please!
I am using someone else's code. When I encountered the line
lRetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "RegistryLoc",0,_ KEY_ALL_ACCESS, hKey)
it came up with an error saying method or data member not defined. I did a search and found that this RegOpenKeyEx is an API for accessing the Registry. I copied and pasted the following code from MSDN into my project:
Declare Function RegOpenKeyEx Lib "advapi32" Alias _
"RegOpenKeyExA" (ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, _
phkResult As Long) As Long
Now when I run it, it comes up with an error where I pass the API HKEY_LOCAL_MACHINE saying variable not defined.
If I put HKEY_LOCAL_MACHINE in quotes, the program generates an error.
What am I doing wrong?? Any advice, please!