MSComm1.Output =<Property is write-only>是什么错误?
Private Sub Form_Activate()Static idle1 As Integer
If idle1 Then Exit Sub
MSComm1.CommPort = 1
MSComm1.InBufferSize = 1024
MSComm1.InBufferCount = 0
MSComm1.InputLen = 0
MSComm1.RThreshold = 0
MSComm1.OutBufferSize = 512
MSComm1.OutBufferCount = 0
MSComm1.SThreshold = 0
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If
MSComm1.Output = "A"
End Sub
为什么运行时会出现
MSComm1.Output =<Property is write-only>的错误呢?
请各位大虾帮忙解释一下 --------------------编程问答-------------------- 设置它的InpotMode,Settins试一试 --------------------编程问答-------------------- 代码运行未见<Property is write-only> 的错误呢?
代码修改如下:
--------------------编程问答-------------------- 代码没有问题,是否串口的问题。
Private Sub Form_Activate()
Static idle1 As Integer
'If idle1 Then Exit Sub '此句代码条件无判断
If Not MSComm1.PortOpen Then
MSComm1.CommPort = 1
MSComm1.InBufferSize = 1024
MSComm1.InBufferCount = 0
MSComm1.InputLen = 0
MSComm1.RThreshold = 0
MSComm1.OutBufferSize = 512
MSComm1.OutBufferCount = 0
MSComm1.SThreshold = 0
MSComm1.PortOpen = True
End If
MSComm1.Output = "A"
End Sub
补充:VB , 基础类