发表于:2005/3/4 9:31:00
#0楼
我用MCSCOMM控件编了一个简单的程序,创建了一个Form窗口,添加两个文本控件Text1、Text2,和一个Command1、一个MSComm1_OnComm。我用RS232将两台电脑连起来,结果不能通讯,COM口,我用网上下的程序试了,是没问题,可以通讯。我的程序代码如下:
Private Sub Command1_Click()
Dim number$
number$ = Text1.Text
Text2.Text = Text1.Text
End Sub
Private Sub Form_Load()
MSComm1.CommPort = 1
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
Dim read As String
read = ""
Text2.Text = read & MSComm1.Input
Case comEvSend
read = ""
Text2.Text = read & MSComm1.Output
End Select
End Sub
请问错在哪?如果你忙,有空回答我。
祝工作顺利、好晕连连!
Private Sub Command1_Click()
Dim number$
number$ = Text1.Text
Text2.Text = Text1.Text
End Sub
Private Sub Form_Load()
MSComm1.CommPort = 1
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
Dim read As String
read = ""
Text2.Text = read & MSComm1.Input
Case comEvSend
read = ""
Text2.Text = read & MSComm1.Output
End Select
End Sub
请问错在哪?如果你忙,有空回答我。
祝工作顺利、好晕连连!