虽然说编译能通过,但调用不成功,我现将代码贴出来,请高手指点:<br>1、DLL中函数原型及示例:<br>【函数原型】<br>int WINAPI SubmitA(unsigned char OrgTON, unsigned char OrgNPI, LPCTSTR OrgAddr,<br> unsigned char DestTON, unsigned char DestNPI, LPCTSTR DestAddr, <br>unsigned char PRI, unsigned char RD, unsigned char RP, unsigned char SRR,<br> unsigned char MR, unsigned char DCS, unsigned char PID, LPCTSTR Schedule,<br> LPCTSTR Expire, unsigned long Default_ID, unsigned char UDHI, <br>unsigned long UDLen, LPCTSTR UserData, unsigned long* SM_ID, <br>unsigned char* FCS);<br>其中输出参数:<br>SM_ID 类型:unsigned long*<br> 意义:返回短消息ID<br>FCS 类型:unsigned char*<br> 意义:返回SC端失败原因<br>【调用举例】<br>unsigned char PRI = 0, DCS = 8, RD = 0, RP = 0, SRR = 0, MR = 0, PID = 0;<br>unsigned long default_id = 0;<br>unsigned char UDHI = 0;<br>Cstring UserData = "你好,我已到达。";<br>unsigned long UDLen = UserData.GetLength();<br> unsigned long SM_ID;<br> unsigned char FCS;<br>int iRet = SubmitA(2, 1, "1392700001", 2, 1, "1392700002", PRI, RD, RP, <br> SRR, MR, DCS, PID, "1998/01/01 08:00:00", "1998/01/01 20:30:00", default_id,<br> 0, UDLen, (LPCTSTR)UserData, &SM_ID, &FCS);<br>if (iRet != 0)<br> AfxMessageBox("短讯发送失败");<br><br>下面为DELPHI中代码:<br>var <br> SubmitA:function( OrgTON,OrgNPI:byte; Orgaddr:string;DestTON,DestNPI:byte; DestAddr:string;<br> PRI,RD,Rp,SRR,MR,DCS,PID:byte; Schedule,Expire:string; Defautlt_ID:longWord;<br> UDHI:byte; UDLen:LongWord; USerdata:string; SM_ID:cardinal; FCS:byte):Longword;stdcall;<br>procedure TfrmMain.BitBtn1Click(Sender: TObject);<br>var<br> PRI,DCS,RD,RP,SRR,MR,PID:byte;<br> default_id:longWord;<br> UDHI:byte;<br> Userdata:string;<br> UdLen:longWord;<br> SM_ID:cardinal;<br> FCS:byte;<br> iRet:Longword;<br>begin<br> PRI:=0;<br> DCS:=8;<br> RD:=0;<br> RP:=0;<br> SRR:=0;<br> MR:=0;<br> PID:=0;<br> default_id:=0;<br> UDHI:=0;<br> Userdata:='你好,测试';<br> Udlen:=length(Userdata);<br> iRet:=SubmitA(2,1,'555588',2,1,'13900000001',PRI,RD,RP,<br> SRR,MR,DCS,PID,'2002/08/05 08:00:00', '2002/08/05 20:30:00', <br> default_id,UDHI,Udlen, Userdata, SM_ID,FCS);<br> if iret<>0 then<br> showmessage('短信发送失败');<br>end;<br><br>调用时产生Access violation at address 00000000.Read of adddress 00000000.<br>的错误信息,请大侠们指点<br><br><br><br>