高手请进(200分)

  • 主题发起人 love_xinwang
  • 开始时间
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>&nbsp; &nbsp; &nbsp; &nbsp; unsigned char byFeeUserType, LPCTSTR sSPID, LPCTSTR sFeeType, <br>&nbsp; &nbsp; &nbsp; &nbsp; LPCTSTR sFeeAddr, LPCTSTR sFeeCode,unsigned char byUserNum, <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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; &nbsp; &nbsp; &nbsp; //业务子类型 by ycl 2001.7.9 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20<br>byMsgID:pbyte; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MAX_MSG_ID,CMPP的字段,消息ID<br>byPKTotal:Byte; &nbsp; &nbsp; &nbsp; &nbsp; //相同Msg_id的消息总条数,从1开始<br>byPKNumber:Byte; &nbsp; &nbsp; &nbsp; &nbsp;//相同Msg_id的消息序号,从1开始<br>byMsglevel:Byte; &nbsp; &nbsp; &nbsp; &nbsp;//信息级别<br>byFeeUserType:Byte; &nbsp; &nbsp; //计费用户类型字段,0:对目的终端MSISDN计费;<br> &nbsp; &nbsp;//1:对源终端MSISDN计费;2:对SP计费;3:表示本字段无效<br>sSPID:LPCTSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//MAX_SPID_LEN,信息内容来源<br>sFeeType:LPCTSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MAX_FEE_TYPE_LEN,资费类别<br>sFeeAddr:LPCTSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MAX_ADDR_LEN,被计费用户地址<br>sFeeCode:LPCTSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MAX_FEE_CODE_LEN,资费代码<br>byUserNum:Byte; &nbsp; &nbsp; &nbsp; &nbsp; //接收消息的用户数量<br>sDestAddrs:LPCTSTR; &nbsp; &nbsp; &nbsp; &nbsp; //目的地址,最多100个<br><br>SM_ID : PULong;<br>FCS : PByte):integer;stdcall; external 'SMEIDLL.DLL';<br>调用如下:<br>procedure TForm1.Button7Click(Sender: TObject);<br>var &nbsp;OrgTON,OrgNPI,DestTON,DestNPI,PRI,RD,RP:byte; //7<br>var &nbsp;SRR,MR,DCS,PID,UDHI :byte; &nbsp; //5<br>var &nbsp;Default_ID,UDLen:ulong; &nbsp; &nbsp;//2<br>var &nbsp;OrgAddr,DestAddr,Schedule,Expire,UserData:LPCTSTR; //5<br>var &nbsp;P_SM_ID:^ulong;<br>var &nbsp;P_FCS:^uchar;<br>var &nbsp;P_MsgID:^uchar;<br>var &nbsp;MsgID:pbyte;<br>var &nbsp;PSM_ID:pulong;<br>var &nbsp;PFCS:pByte;<br>var &nbsp;i:integer;<br>begin<br>&nbsp;New(PSM_ID);<br>&nbsp;New(PFCS);<br>&nbsp;New(MsgID);<br><br>&nbsp;PSM_ID^:=0;<br>&nbsp;PFCS^:=0;<br>&nbsp;MsgID^:=0;<br><br>&nbsp;i:=SubmitAExEx(1,1,'910406',2,1,'13809099962',0,0,0,<br>&nbsp; &nbsp; 0,0,8,0,'2003/03/19 08:00:00','2003/03/19 08:00:00',<br>&nbsp; &nbsp; 0,0,8,pchar('宿迁国税'),<br>&nbsp; &nbsp; pchar('icp'),<br>&nbsp; &nbsp; MsgID,<br>&nbsp; &nbsp; 1,1,0,0,pchar('08406'),<br>&nbsp; &nbsp; pchar('05'),pchar(13809099962),<br>&nbsp; &nbsp; pchar('0000001'),<br>&nbsp; &nbsp; 1,<br>&nbsp; &nbsp; pchar('13809099962'),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PSM_ID,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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>
 
i:=SubmitAExEx(1,1,'910406',2,1,'13809099962',0,0,0,<br>&nbsp; &nbsp; 0,0,8,0,'2003/03/19 08:00:00','2003/03/19 08:00:00',<br>&nbsp; &nbsp; 0,0,8,pchar('宿迁国税'),<br>&nbsp; &nbsp; pchar('icp'),<br>&nbsp; &nbsp; MsgID,<br>&nbsp; &nbsp; 1,1,0,0,pchar('08406'),<br>---&gt; &nbsp; &nbsp;pchar('05'),[red]pchar(13809099962),[/red]<br>&nbsp; &nbsp; pchar('0000001'),<br>&nbsp; &nbsp; 1,<br>&nbsp; &nbsp; pchar('13809099962'),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PSM_ID,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PFCS);<br><br>
 
还是不行呀?
 
接受答案了.
 
顶部