发表于:2005/11/9 18:52:00
#0楼
' 设置模块短信到来提示
Private Function SetSmsTip() As Boolean
On Error GoTo ErrDisp
Dim s As String, sTim As Date
sTim = Now()
With comSms
.InBufferCount = 0
.Output = "AT+CNMI=1,1,0,0,1" + vbCrLf
Do
DoEvents
s = s + comSms.Input
??????S怎么有时候总是接收不到,有时候就可以??为什么?????
Loop Until (InStr(s, "OK") > 0 Or DateDiff("S", sTim, Now()) > 1)
End With
SetSmsTip = (InStr(s, "OK") > 0)
Exit Function
ErrDisp:
mError.WriteErrorLog "frmSms.SetSmsTip", err.number & " " & err.Description
End Function
Private Function SetSmsTip() As Boolean
On Error GoTo ErrDisp
Dim s As String, sTim As Date
sTim = Now()
With comSms
.InBufferCount = 0
.Output = "AT+CNMI=1,1,0,0,1" + vbCrLf
Do
DoEvents
s = s + comSms.Input
??????S怎么有时候总是接收不到,有时候就可以??为什么?????
Loop Until (InStr(s, "OK") > 0 Or DateDiff("S", sTim, Now()) > 1)
End With
SetSmsTip = (InStr(s, "OK") > 0)
Exit Function
ErrDisp:
mError.WriteErrorLog "frmSms.SetSmsTip", err.number & " " & err.Description
End Function