I try to retreive the list of serial port available on win. I try Find the COM ports available on your PC but i receive always -1 (False), i running on Win98, and i not test on other WIN. Any body have already do the list on serial port available
Thank you
p.s. excuse my english
Steve Tremblay
17-03-2004 at 02:05 AM
|
steve_w Level: Moderator Registered: 18-04-2003 Posts: 1159
It works on my pc. Try the code below instead but this will only show free ports. You will also need the Microsoft Comm Control.
Private Sub Command2_Click()
On Error Resume Next ' IN CASE OF INVALID PORTS
For i = 1 To 16
MSComm1.CommPort = i
MSComm1.PortOpen = True
If MSComm1.PortOpen = True Then
MsgBox "COM" & i & " OK", vbInformation
MSComm1.PortOpen = False
Else
MsgBox "COM" & i & " Not OK", vbExclamation
End If