delphi如何调用VC写的dll(100分)

  • 主题发起人 主题发起人 hexiangdong
  • 开始时间 开始时间
H

hexiangdong

Unregistered / Unconfirmed
GUEST, unregistred user!
我用DELPHI调用VC写的dll,其中它包括了几个函数<br>BOOL WINAPI IFInitInterface(DWORD dwCodeProtocol, DWORD dwDriverProtocol, LPCTSTR pDriverParam)<br><br>BOOL WINAPI Login_R(LPCTSTR SystemID, &nbsp;LPCTSTR Password)<br><br>int WINAPI SubmitA(unsigned char OrgTON, unsigned char OrgNPI, <br>LPCTSTR OrgAddr, unsigned char DestTON,unsigned char DestNPI, <br>LPCTSTR DestAddr,unsigned char PRI, unsigned char RD, unsigned char RP, <br>unsigned char SRR, unsigned char MR, unsigned char DCS, unsigned char PID,<br>&nbsp;LPCTSTR Schedule, LPCTSTR Expire, unsigned long Default_ID,<br>&nbsp;unsigned char UDHI, unsigned long UDLen, LPCTSTR UserData, <br>unsigned long* SM_ID, unsigned char* FCS)<br>由于delphi与vc的数据类型有差别,我总是调用不成功,所以请各位大侠帮忙写一下,delphi<br>如何声明,如何调用
 
LPCTSTR &nbsp;对应 PChar<br>DWORD 就是 DWORD ,或者 longword<br>unsigned char 对应 byte<br>unsigned long 就是 DWORD ,或者 longword<br>unsigned long* 是 PDWord<br>unsigned char* 是 PByte<br>BOOL 是 Boolean<br>在delphi中函数的最后记得要 stdcall (和WINAPI对应)<br>比如: function IFInitInterface(......):Boolean;stdcall;external 'xxx.dll';
 
后退
顶部