在下面程序段中 gettickcount()为什么会提示没定义啊
Buffer = Hex$(128) MSComm1.Output = Trim(Buffer)
wt = gettickcount()
Do
DoEvents
Loop Until gettickcount - wt > 3000 Or MSComm1.InBufferCount > 0
MsgBox ("未收到握手信号")
Buffer = Hex$(128) MSComm1.Output = Trim(Buffer)
wt = gettickcount()
Do
DoEvents
Loop Until gettickcount - wt > 3000 Or MSComm1.InBufferCount > 0
MsgBox ("未收到握手信号")
Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
我的这部分程序是这样的
Private Sub cmdComm_Click()
Dim Buffer as string
Dim wt&
'选择串口
MSComm1.CommPort = 1
'打开设定Com1
MSComm1.PortOpen = True
MSComm1.Settings = "2400,N,8,1"
'2400波特率,无校验,8位数据位,1位停止位
MSComm1.InputLen = 0
MSComm1.OutBufferCount = 0
'清空发送缓冲区
MSComm1.InBufferCount = 0
'清空接收缓冲区
MSComm1.RThreshold = 1
MSComm1.EOFEnable = True
'发送字符数据,提示准备发送
Buffer = Hex$(128) MSComm1.Output = Trim(Buffer)
wt = GetTickCount()
Do
DoEvents
Loop Until GetTickCount - wt > 3000 Or MSComm1.InBufferCount > 0
MsgBox ("未收到握手信号")
End Sub
Private Declare Function GetTickCount Lib "kernel32" () As LongPrivate Sub cmdComm_Click()
Dim Buffer as string
Dim wt&
'选择串口
MSComm1.CommPort = 1
'打开设定Com1
MSComm1.PortOpen = True
MSComm1.Settings = "2400,N,8,1"
'2400波特率,无校验,8位数据位,1位停止位
MSComm1.InputLen = 0
MSComm1.OutBufferCount = 0
'清空发送缓冲区
MSComm1.InBufferCount = 0
'清空接收缓冲区
MSComm1.RThreshold = 1
MSComm1.EOFEnable = True
'发送字符数据,提示准备发送
Buffer = Hex$(128) MSComm1.Output = Trim(Buffer)
wt = GetTickCount()
Do
DoEvents
Loop Until GetTickCount - wt > 3000 Or MSComm1.InBufferCount > 0
MsgBox ("未收到握手信号")
End Sub