N
NerdRunner
I have been scouring the newsgroups and Microsoft's website and have
not come across a simple example of reading a value from the registry
on the PocketPC. I have created the following procedure...
Dim iretval As Long
Dim lngResult As Long
Dim lngKeyPointer As Long
Dim lpData(1000) As Byte
Dim lpType As Long
Dim lpcbData As Long
Dim key As String
Dim subKey As String
Dim lpValue As Long
Dim Value As String
iretval = ConnectRapi()
key = "Comm\AsyncMac"
subKey = "DisplayName"
lngResult = CeRegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, 0,
lngKeyPointer)
If lngResult <> 0 Then
iretval = DisconnectRapi()
Exit Sub
End If
lngResult = CeRegQueryValueEx(lngKeyPointer, subKey, 0, lpType,
lpData(0), lpcbData)
**lngResult is always 2 never 0**
If lngResult = 0 Then
Value = UnicodeToAnsiByte(lpData)
MsgBox Value
End If
iretval = DisconnectRapi()
I have verified that the key exists and that it has a value in the
registry.
I wish to ultimately use this to determine what version of the .NET CF
is installed on the handheld, but one thing at a time.
I would greatly appreciate anyone pointing out what I am doing wrong
and why my code does not work.
Sean M. Severson
not come across a simple example of reading a value from the registry
on the PocketPC. I have created the following procedure...
Dim iretval As Long
Dim lngResult As Long
Dim lngKeyPointer As Long
Dim lpData(1000) As Byte
Dim lpType As Long
Dim lpcbData As Long
Dim key As String
Dim subKey As String
Dim lpValue As Long
Dim Value As String
iretval = ConnectRapi()
key = "Comm\AsyncMac"
subKey = "DisplayName"
lngResult = CeRegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, 0,
lngKeyPointer)
If lngResult <> 0 Then
iretval = DisconnectRapi()
Exit Sub
End If
lngResult = CeRegQueryValueEx(lngKeyPointer, subKey, 0, lpType,
lpData(0), lpcbData)
**lngResult is always 2 never 0**
If lngResult = 0 Then
Value = UnicodeToAnsiByte(lpData)
MsgBox Value
End If
iretval = DisconnectRapi()
I have verified that the key exists and that it has a value in the
registry.
I wish to ultimately use this to determine what version of the .NET CF
is installed on the handheld, but one thing at a time.
I would greatly appreciate anyone pointing out what I am doing wrong
and why my code does not work.
Sean M. Severson