应该可以
试着 打开 某个 串口
分析出错信息
给几行代码吧
Private Sub Form_Load()
On Error GoTo Handle_Error
For i = 1 To 16
MSComm1.CommPort = i
MSComm1.PortOpen = True
'If Err.Number = comPortInvalid Then
' Print "Error"
'Else
Combo1.AddItem "COM" & i
'End If
MSComm1.PortOpen = False
Next i
Handle_Error: Print "Error"
End Sub
我调试过,Combo1里列出了3个串口