L
love_xinwang
Unregistered / Unconfirmed
GUEST, unregistred user!
是华为的API,我现在要用DELPHI调用,原型如下:<br>int WINAPI SubmitAExEx(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, <br> unsigned char SRR, unsigned char MR, unsigned char DCS, <br> unsigned char PID, LPCTSTR Schedule, LPCTSTR Expire, <br> unsigned long Default_ID, unsigned char UDHI, unsigned long UDLen,<br> LPCTSTR UserData, LPCTSTR ServiceSubType, <br> unsigned char* byMsgID, unsigned char byPKTotal, <br> unsigned char byPKNumber, unsigned char byMsglevel, <br> unsigned char byFeeUserType, LPCTSTR sSPID, LPCTSTR sFeeType, <br> LPCTSTR sFeeAddr, LPCTSTR sFeeCode,unsigned char byUserNum, <br> LPCTSTR sDestAddrs, unsigned long* SM_ID, unsigned char* FCS)<br>我声明如下:<br>function SubmitAExEx(<br>OrgTON : Byte ;<br>OrgNPI : Byte ;<br>OrgAddr : LPCTSTR ;<br>DestTON : Byte;<br>DestNPI : Byte;<br>DestAddr :LPCTSTR;<br>PRI : Byte;<br>RD : Byte;<br>RP : Byte;<br>SRR : Byte;<br>MR : Byte;<br>DCS : Byte;<br>PID : Byte;<br>Schedule : LPCTSTR ;<br>Expire : LPCTSTR ;<br>Default_ID : Longword;<br>UDHI : Byte;<br>UDLen : ULong;<br>UserData : LPCTSTR;<br><br>sServiceType:LPCTSTR; //业务子类型 by ycl 2001.7.9 20<br>byMsgIDbyte; //MAX_MSG_ID,CMPP的字段,消息ID<br>byPKTotal:Byte; //相同Msg_id的消息总条数,从1开始<br>byPKNumber:Byte; //相同Msg_id的消息序号,从1开始<br>byMsglevel:Byte; //信息级别<br>byFeeUserType:Byte; //计费用户类型字段,0:对目的终端MSISDN计费;<br> //1:对源终端MSISDN计费;2:对SP计费;3:表示本字段无效<br>sSPID:LPCTSTR; //MAX_SPID_LEN,信息内容来源<br>sFeeType:LPCTSTR; //MAX_FEE_TYPE_LEN,资费类别<br>sFeeAddr:LPCTSTR; //MAX_ADDR_LEN,被计费用户地址<br>sFeeCode:LPCTSTR; //MAX_FEE_CODE_LEN,资费代码<br>byUserNum:Byte; //接收消息的用户数量<br>sDestAddrs:LPCTSTR; //目的地址,最多100个<br><br>SM_ID : PULong;<br>FCS : PByte):integer;stdcall; external 'SMEIDLL.DLL';<br>调用如下:<br>procedure TForm1.Button7Click(Sender: TObject);<br>var OrgTON,OrgNPI,DestTON,DestNPI,PRI,RD,RP:byte; //7<br>var SRR,MR,DCS,PID,UDHI :byte; //5<br>var Default_ID,UDLen:ulong; //2<br>var OrgAddr,DestAddr,Schedule,Expire,UserData:LPCTSTR; //5<br>var P_SM_ID:^ulong;<br>var P_FCS:^uchar;<br>var P_MsgID:^uchar;<br>var MsgIDbyte;<br>var PSM_IDulong;<br>var PFCSByte;<br>var i:integer;<br>begin<br> New(PSM_ID);<br> New(PFCS);<br> New(MsgID);<br><br> PSM_ID^:=0;<br> PFCS^:=0;<br> MsgID^:=0;<br><br> i:=SubmitAExEx(1,1,'910406',2,1,'13809099962',0,0,0,<br> 0,0,8,0,'2003/03/19 08:00:00','2003/03/19 08:00:00',<br> 0,0,8,pchar('宿迁国税'),<br> pchar('icp'),<br> MsgID,<br> 1,1,0,0,pchar('08406'),<br> pchar('05'),pchar(13809099962),<br> pchar('0000001'),<br> 1,<br> pchar('13809099962'),<br> PSM_ID,<br> PFCS);<br><br><br>Dispose(PSM_ID);<br>Dispose(PFCS);<br>Dispose(MsgID);<br><br><br>end;<br><br><br>老是报如下错误:“project project2 raised exception class EAccessvialation with message'Access violation at address 1006142 in modual "smeidll.dll".read of address 371624BA.Process stoped .use step or run to continue.<br>