B
Brian Patrick
I cannot seem to get the following code to work in VB.net:
----------------------------------------------------------------------------
-------------------------
Const HKEY_LOCAL_MACHINE = &H80000002
Declare Function RegConnectRegistry Lib "advapi32.dll" Alias
"RegConnectRegistryA" _
(ByVal lpMachineName As String, ByVal hKey As Int32, ByVal phkResult As
Int32) As Int32
(the code below would be placed in a sub or function)
Dim lReturnCode as Int32
Dim lhRemoteRegistry as Int32
lReturnCode = RegConnectRegistry("\\MyMachine", HKEY_LOCAL_MACHINE,
lhRemoteRegistry)
----------------------------------------------------------------------------
-------------------------
lReturnCode always returns 1780, when it should be returning zero. If I
take this same code and copy it into a VB 6 project (changing the Int32's to
Long's of course) it works perfectly and connects to the remote registry.
Any ideas?
Thanks,
Brian
----------------------------------------------------------------------------
-------------------------
Const HKEY_LOCAL_MACHINE = &H80000002
Declare Function RegConnectRegistry Lib "advapi32.dll" Alias
"RegConnectRegistryA" _
(ByVal lpMachineName As String, ByVal hKey As Int32, ByVal phkResult As
Int32) As Int32
(the code below would be placed in a sub or function)
Dim lReturnCode as Int32
Dim lhRemoteRegistry as Int32
lReturnCode = RegConnectRegistry("\\MyMachine", HKEY_LOCAL_MACHINE,
lhRemoteRegistry)
----------------------------------------------------------------------------
-------------------------
lReturnCode always returns 1780, when it should be returning zero. If I
take this same code and copy it into a VB 6 project (changing the Int32's to
Long's of course) it works perfectly and connects to the remote registry.
Any ideas?
Thanks,
Brian