P
Paul [Paradise Solutions]
Hi there
I would have posted this in the OpenNetCF forums, but for some reason I
can't register and I need to get this question asked.
I'm using the Communications DLL (and top stuff it is too) but I'm
getting a slight problem with opening a registry key on the PDA from the
desktop.
Using OpenSubKey, Ims attempting to access the key:
Software\BAC\PDASales
But the call is returning an error saying "The length of the specified
subkey is longer than the maximum amount (255)"
I've put the code I'm using at the end, and it's running inside a form.
Many thanks for your assistance
Paul
Try
'// connect to PDA via rapi
p_Rapi.Connect()
'// show state
StatusBar1.Text = "Loading Generic PDA data..."
'// Get device name
p_RegKey = p_Reg.LocalMachine.OpenSubKey("Ident")
lblDeviceName.Text = p_RegKey.GetValue("Name")
p_RegKey.Close()
'// get sync list
p_RegKey = p_Reg.LocalMachine.OpenSubKey("Software\BAC")
MessageBox.Show(p_RegKey.SubKeyCount.ToString)
Dim SubKeys() As String
Dim SubKeyCounter As Int16
Dim SubKeyMax As Int16
'// Get sub keys from BAC
SubKeys = p_RegKey.GetSubKeyNames()
p_RegKey.Close()
SubKeyMax = SubKeys.Length - 1
'// Loop through subkeys checking for "sync" value
For SubKeyCounter = 0 To SubKeyMax
'MessageBox.Show(SubKeys(SubKeyCounter))
'***Blows up here****
p_RegKey = p_Reg.LocalMachine.OpenSubKey("Software\BAC\PDASales")
Try
MessageBox.Show(p_RegKey.GetValue("Sync"))
Catch ex As Exception
MessageBox.Show("Element " + SubKeys(SubKeyCounter) + " had
no " _ "sync setting")
End Try
p_RegKey.Close()
Application.DoEvents()
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
'// Ensure disconnect
If p_Rapi.Connected Then
p_Rapi.Disconnect()
End If
End Try
I would have posted this in the OpenNetCF forums, but for some reason I
can't register and I need to get this question asked.
I'm using the Communications DLL (and top stuff it is too) but I'm
getting a slight problem with opening a registry key on the PDA from the
desktop.
Using OpenSubKey, Ims attempting to access the key:
Software\BAC\PDASales
But the call is returning an error saying "The length of the specified
subkey is longer than the maximum amount (255)"
I've put the code I'm using at the end, and it's running inside a form.
Many thanks for your assistance
Paul
Try
'// connect to PDA via rapi
p_Rapi.Connect()
'// show state
StatusBar1.Text = "Loading Generic PDA data..."
'// Get device name
p_RegKey = p_Reg.LocalMachine.OpenSubKey("Ident")
lblDeviceName.Text = p_RegKey.GetValue("Name")
p_RegKey.Close()
'// get sync list
p_RegKey = p_Reg.LocalMachine.OpenSubKey("Software\BAC")
MessageBox.Show(p_RegKey.SubKeyCount.ToString)
Dim SubKeys() As String
Dim SubKeyCounter As Int16
Dim SubKeyMax As Int16
'// Get sub keys from BAC
SubKeys = p_RegKey.GetSubKeyNames()
p_RegKey.Close()
SubKeyMax = SubKeys.Length - 1
'// Loop through subkeys checking for "sync" value
For SubKeyCounter = 0 To SubKeyMax
'MessageBox.Show(SubKeys(SubKeyCounter))
'***Blows up here****
p_RegKey = p_Reg.LocalMachine.OpenSubKey("Software\BAC\PDASales")
Try
MessageBox.Show(p_RegKey.GetValue("Sync"))
Catch ex As Exception
MessageBox.Show("Element " + SubKeys(SubKeyCounter) + " had
no " _ "sync setting")
End Try
p_RegKey.Close()
Application.DoEvents()
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
'// Ensure disconnect
If p_Rapi.Connected Then
p_Rapi.Disconnect()
End If
End Try