ipman 大哥,看看,不对啊!
tyfun 2003-11-21 03:08:57 我怎么得到SMGPDeliver函数里pDeliverResp指针?
'接收短信
Private Declare Function SMGPDeliver Lib "SmGwAPI.dll" (nTimeout As Integer, _
ByRef pDeliverResp As Long) As Long
'指针
Private Declare Sub CopyMemory Lib "kernel32 " Alias "RtlMoveMemory " _
(Destination As Any, Source As Any, ByVal Length As Long)
'接收
Public Sub Recieve()
Type ShortMsg
sMsgID(10) As Byte '短消息标识
nIsReport As Integer '是否状态报告
nMsgFormat As Integer '信息格式
sRecvTime(15) As Byte '接收时间((格式:yyyymmddhhmiss,例如20010301200000)
sSrcrmID(21) As Byte '发送消息的源终端号码
sDestTermID(21) As Byte 'Char(22) 发送消息的目的号码
nMsgLen As Integer '短消息长度
sMsgContent(251) As Byte 'Char(252) 短消息内容
End Type
Dim DataBuf(315) As Byte
Dim myMsg As ShortMsg
ret = SMGPDeliver(10, VarPtr(DataBuf(0)))
CopyMemory myMsg, DataBuf(0), LenB(myMsg)
End Sub