|
-
Nov 6th, 2019, 09:15 AM
#1
Thread Starter
New Member
VB6 reading registry 32bit and 64bit
If anyone can send me in the right direction. It would be appreciate.
I have a vb6 program that works fine in win10 32 bit but not in win10 64 bit. It gives me a runtime error when I call a subroutine to read registry values?
Private Sub Registry()
MsgBox " I am in sub registry this displays fine"
Server_Name = regQuery_A_Key(HKEY_LOCAL_MACHINE, _ "SOFTWARE\CraneKemlite\Shared\System Connection", _
"SERVER")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Get a runtime error never prints my next msgbox'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function regQuery_A_Key(ByVal lngRootKey As Long, _
ByVal strRegKeyPath As String, _
ByVal strRegSubKey As String) As Variant
' --------------------------------------------------------------
' ' Important: If you treat all key data strings as being case sensitive, you should never have a problem.
' Always backup your registry files (System.dat and User.dat) before performing any type of modifications
'
' Description: Function for querying a sub key value.
'
' Parameters:
' lngRootKey - HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_lOCAL_MACHINE, HKEY_USERS, etc
' strRegKeyPath - is name of the key path you wish to traverse.
' strRegSubKey - is the name of the key which will be queryed.
'
' Syntax:
' strKeyQuery = regQuery_A_Key(HKEY_CURRENT_USER, _
' "Software\AAA-Registry Test\Products", _
"StringTestData")
'
' Returns the key value of "StringTestData"
' --------------------------------------------------------------
' --------------------------------------------------------------
' Define variables
' --------------------------------------------------------------
Dim intPosition As Integer
Dim lngKeyHandle As Long
Dim lngDataType As Long
Dim lngBufferSize As Long
Dim lngBuffer As Long
Dim strBuffer As String
' --------------------------------------------------------------
' Initialize variables
' --------------------------------------------------------------
'CB2019
MsgBox "I am in regQuery_A_Key"
'CB2019
MsgBox ("The value after is " & lngRootKey)
MsgBox ("The value after is " & strRegKeyPath)
MsgBox ("The value after is " & strRegSubKey)
lngKeyHandle = 0
lngBufferSize = 0
Tags for this Thread
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
|