调用华为的SMEIDLL.dll中的SubmitAExEx函数发送返回总是4,高手速来急救!(解决后另赠200分) ( 积分: 300 )

  • 主题发起人 主题发起人 dragonwzw
  • 开始时间 开始时间
D

dragonwzw

Unregistered / Unconfirmed
GUEST, unregistred user!
函数为:<br>function SubmitAExEx(OrgTON, OrgNPI: Byte; OrgAddr: &nbsp;LPCSTR; DestTON, DestNPI: Byte; DestAddr: LPCSTR;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PRI, RD, RP, SRR, MR, DCS, PID: Byte; Schedule, Expire: LPCSTR;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Default_ID: longword; UDHI: Byte; UDLen: longword; UserData, ServiceSubType: LPCSTR;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byMsgID: PByte; byPKTotal, byPKNumber, byMsglevel, byFeeUserType: Byte;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sSPID, sFeeType, sFeeAddr, sFeeCode: LPCSTR; byUserNum: Byte;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sDestAddrs: LPCSTR; SM_ID: Plongword; FCS: PByte): integer; external 'smeidll.dll';<br><br>如下调用:<br>procedure TForm1.Button5Click(Sender: TObject);<br>var<br> &nbsp;ret: integer;<br> &nbsp;byMsgID : Byte;<br> &nbsp;SM_ID : Longword;<br> &nbsp;FCS : Byte;<br> &nbsp;d: TSubmitAExEx;<br> &nbsp;Schedule,Expire: string;<br>begin<br> &nbsp;Schedule:=FormatDateTime('yyyy/MM/dd hh:mm:ss',Now);<br> &nbsp;Expire:=FormatDateTime('yyyy/MM/dd hh:mm:ss',Now+0.5);<br> &nbsp;ret:=d(2,1,'040222',1,1,'8613760818278',0,0,0,0,0,8,0,PAnsiChar(Schedule),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PAnsiChar(Expire),0,0,4,'test','icp',@byMsgID, &nbsp; &nbsp; &nbsp; //MAX_MSG_ID,CMPP的字段,消息ID<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1,1,0,1,'spid','01','','11',1,'040222',@SM_ID,@FCS);<br> &nbsp;showmessage(inttostr(ret));<br>end;<br><br>每次ret返回都是4, 请问是什么原因?<br>而且还会出现这样的错误提示:<br> &nbsp; 'Access violation at address 3134319 in modual &quot;smeidll.dll&quot;.read of address 3134319.<br>请用过的高手急救呀!
 
函数为:<br>function SubmitAExEx(OrgTON, OrgNPI: Byte; OrgAddr: &nbsp;LPCSTR; DestTON, DestNPI: Byte; DestAddr: LPCSTR;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PRI, RD, RP, SRR, MR, DCS, PID: Byte; Schedule, Expire: LPCSTR;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Default_ID: longword; UDHI: Byte; UDLen: longword; UserData, ServiceSubType: LPCSTR;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byMsgID: PByte; byPKTotal, byPKNumber, byMsglevel, byFeeUserType: Byte;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sSPID, sFeeType, sFeeAddr, sFeeCode: LPCSTR; byUserNum: Byte;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sDestAddrs: LPCSTR; SM_ID: Plongword; FCS: PByte): integer; external 'smeidll.dll';<br><br>如下调用:<br>procedure TForm1.Button5Click(Sender: TObject);<br>var<br> &nbsp;ret: integer;<br> &nbsp;byMsgID : Byte;<br> &nbsp;SM_ID : Longword;<br> &nbsp;FCS : Byte;<br> &nbsp;d: TSubmitAExEx;<br> &nbsp;Schedule,Expire: string;<br>begin<br> &nbsp;Schedule:=FormatDateTime('yyyy/MM/dd hh:mm:ss',Now);<br> &nbsp;Expire:=FormatDateTime('yyyy/MM/dd hh:mm:ss',Now+0.5);<br> &nbsp;ret:=d(2,1,'040222',1,1,'8613760818278',0,0,0,0,0,8,0,PAnsiChar(Schedule),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PAnsiChar(Expire),0,0,4,'test','icp',@byMsgID, &nbsp; &nbsp; &nbsp; //MAX_MSG_ID,CMPP的字段,消息ID<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1,1,0,1,'spid','01','','11',1,'040222',@SM_ID,@FCS);<br> &nbsp;showmessage(inttostr(ret));<br>end;<br><br>每次ret返回都是4, 请问是什么原因?<br>而且还会出现这样的错误提示:<br> &nbsp; 'Access violation at address 3134319 in modual &quot;smeidll.dll&quot;.read of address 3134319.<br>请用过的高手急救呀!
 
你的D函数声明了没有,怎么那么多参数呀
 
声明了呀,函数原型是在SMEIDLL.dll中包含的,我是在外部调用!
 
估计不是调用约定错误就是参数不对<br>最好将函数原型贴出
 
函数原型为:<br>int WINAPI SubmitAExEx(unsigned char OrgTON, unsigned char OrgNPI, LPCSTR OrgAddr,<br> unsigned char DestTON, unsigned char DestNPI, LPCSTR DestAddr, <br> unsigned char PRI, unsigned char RD, unsigned char RP, <br> unsigned char SRR, unsigned char MR, unsigned char DCS, <br> unsigned char PID, LPCSTR Schedule, LPCSTR Expire, <br> unsigned long Default_ID, unsigned char UDHI, unsigned long UDLen,<br> LPCSTR UserData, LPCSTR ServiceSubType, <br> unsigned char* byMsgID, unsigned char byPKTotal, <br> unsigned char byPKNumber, unsigned char byMsglevel, <br> &nbsp; &nbsp; &nbsp; &nbsp;unsigned char byFeeUserType, LPCSTR sSPID, LPCSTR sFeeType, <br> &nbsp; &nbsp; &nbsp; &nbsp;LPCSTR sFeeAddr, LPCSTR sFeeCode,unsigned char byUserNum, <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LPCSTR sDestAddrs, unsigned long* SM_ID, unsigned char* FCS)<br>注:SubmitAExEx适用于CMPP协议(移动)。<br><br>》》》谢谢maze兄了!<br>还望高手们指正!!!
 
这个贴子都一个星期了呀,大侠们快来帮帮我呀!
 
unsigned char* byMsgID =&gt;byMsgID: pchar
 
虽然问题没有解决,还是要谢谢大家的支持!
 
后退
顶部