K
kaga
Unregistered / Unconfirmed
GUEST, unregistred user!
//说明: 动态链接库是用C语言开发的'SMGWAPI.DLL'<br>接收短信 SMGPDeliver()<br>-------------------------------------------------------------------------------<br>参数名 数据类型 说明<br>-------------------------------------------------------------------------------<br>nTimeout nt 输入等待的最大延时,如果是0表示永远等待。单位为秒<br>pDeliverResp DeliverResp* 保存短信的DeliverResp结构指针<br>------------------------------------------------------------------------------<br><br>DeliverResp结构<br>---------------------------------------------------------<br>参数名 数据类型 说明<br>---------------------------------------------------------<br>sMsgID char(11) 短消息标识<br>nIsReport Int 是否状态报告:=1<br>nMsgFormat Int 信息格式:填写=15<br>sRecvTime char(16) 接收时间yyyymmddhhmiss<br>sSrcTermID char(22) 本机号码(1061222)<br>sDestTermID char(22) 对方号码<br>nMsgLen Int 短信长度<br>sMsgContent char(22) 短信内容<br>--------------------------------------------------------<br><br>unit uSMGWAPI;<br>uses <br> ......<br>type<br> PDeliverResp = ^TDeliverResp;<br> TDeliverResp = record<br> sMsgID : Array[0..10] of char;<br> nIsReport : Integer;<br> nMsgFormat : Integer;<br> sRecvTime : Array[0..15] of char;<br> sSrcTermID : Array[0..21] of char;<br> sDestTermID : Array[0..21] of char;<br> nMsgLen : Integer;<br> sMsgContent : Array[0..251] of char;<br> end;<br>.....<br> function SMGPDeliver(const nTimeout : Integer; pDr : PDeliverResp):Integer;stdcall;external 'SMGWAPI.DLL';<br>....<br><br><br>主程序中调用<br>uses<br> uSMGWAPI;<br>.....<br><br> PDeliverResp = ^TDeliverResp;<br> TDeliverResp = record<br> sMsgID : Array[0..10] of char;<br> nIsReport : Integer;<br> nMsgFormat : Integer;<br> sRecvTime : Array[0..15] of char;<br> sSrcTermID : Array[0..21] of char;<br> sDestTermID : Array[0..21] of char;<br> nMsgLen : Integer;<br> sMsgContent : Array[0..251] of char;<br> end;<br><br>procedure TfrmServer.Timer1Timer(Sender: TObject);<br>var<br> i : Integer; <br> pDr : PDeliverResp;<br>begin<br> new(pDr);<br> if uSMGWAPI.SMGPDeliver(3,pDr)=0 then //这里提示错误<br> memLog.lines.add(pDr^.sMsgID+pDr^.sMsgContent+pDr^.sSrcTermID); <br> Dispose(pDr);<br><br>end;<br>--------------------------------------------------------------<br>编译提示错误:types of actual and formal var parameters must be indentical.<br>--------------------------------------------------------------<br>另外,我把短信接收的结构(uSMGWAPI,uServer中)均修改为:<br>TDeliverResp= record<br> sMsgID : PChar;<br> nIsReport : Integer;<br> nMsgFormat : Integer;<br> sRecvTime : PChar;<br> sSrcTermID : PChar;<br> sDestTermID : PChar;<br> nMsgLen : Integer;<br> sMsgContent : PChar;<br> end;<br> PDeliverResp=^TDeliverResp;<br>也提示错误?<br><br>请问各位大侠,我应该如何处理该结构?