求助VB中MScomm 与手机通话问题(贴出代码)?
Private Sub Command1_Click() '拨打电话
If Text1.Text = "" Then
MsgBox "请输入电话号码!", vbQuestion, "提示信息"
Text1.SetFocus
End If
MSComm2.DTREnable = True
MSComm2.EOFEnable = True
MSComm2.RTSEnable = True
MSComm2.RThreshold = 1
MSComm2.SThreshold = 1
MSComm2.Handshaking = comNone
MSComm2.OutBufferSize = 1024
MSComm2.CommPort = 4 '设置通讯端口号
MSComm2.Settings = "19200,N,8,1" '设置波特率、奇偶校验、数据位、停止位参数
MSComm2.PortOpen = True
MSComm2.InputMode = comInputModeText
MSComm2.OutBufferCount = 0
MSComm2.Output = "ATDT" & Text1.Text & ";" & vbCr
End Sub
Private Sub MSComm2_OnComm()
Dim InBuff As String
Select Case MSComm2.CommEvent
Case comEvCD ' Change in the CD line.
MsgBox "1"
Case comEvCTS ' Change in the CTS line.
MsgBox "2"
Case comEvDSR ' Change in the DSR line.
MsgBox "3"
Case comEvRing ' Change in the Ring Indicator.
MsgBox "4"
Case comEvReceive ' Received RThreshold # of chars.
InBuff = MSComm2.Input
'Call HandleInput(InBuff)
MsgBox InBuff
Case comEvSend ' There are SThreshold number of
MsgBox "5"
' characters in the transmit buffer.
Case comEvEOF ' An EOF character was found in the
MsgBox "6"
' input stream.
End Select
End Sub
上面程序运行后,,,拨通手机,然后接通,挂断通话,这整个过程结速后会返回一个"OK". 现在我想请教各位朋友在(第2步)接通后我怎么让对方手机给程序返回一个结果? 最好麻烦哪位朋友贴代码...不胜感激.