Using the example from the help wiki shown below. Using the first path (from the example) works as expected - the values match what you see via regedit. Substituting the second path to read serial ports - results in values with the last character missing.
Instead of (seen via regedit):
COM13
COM14
COM6
I get the following values:
COM1
COM1
COM6
Any ideas of what the issue could be?
[code]// get a registry key
Dim reg As New RegistryItem(“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion”)
// Dim reg As New RegistryItem(“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM”)
Dim lines() As String
// now we look on all values on this key
For i As Integer = 0 To reg.KeyCount- 1
Dim name As String = reg.Name(i)
Dim value As Variant = reg.Value(i)
lines.Append(name + " -> " + value)
Next
// and display them
MsgBox(Join(lines, EndOfLine))[/code]
I have the same problem using Win7 64bit where the COM ports get cut off.
I used the same commands I used in XP and it worked.
Dim reg As new RegistryItem(“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM”)
In the Registry it shows: COM21, COM24, COM25, COM26
for i as integer = 0 to ports
port = reg.Value(i)
currentports(i) = port
numports = numports +1
next
return numports