MSComm.CommPort = 1
MSComm.PortOpen = True
If MSComm.PortOpen = False Then
MsgBox("请先选择COM口,再选择波特率!", MsgBoxStyle.OKOnly, "ERROR")
Exit Sub
End If
MSComm.Settings = "9600,e,8,1"
MSComm.OutBufferCount = 0
MSComm.InBufferCount = 0
MSComm.InputMode = MSCommLib.InputModeConstants.comInputModeText
Dim cgl As Short
cgl = &H30s
MSComm.Output = cgl
MSComm.Output = cgl
错误提示为:
未处理的“System.Runtime.InteropServices.COMException”类型的异常出现在 axinterop.mscommlib.dll 中。
其他信息: HRESULT 中的异常:0x800A017C (CTL_E_INVALIDPROPERTYVALUE)。