请会C的朋友帮个忙把下面的C的函数声明转为DELPHI的格式(100分)

  • 主题发起人 主题发起人 biyesheng
  • 开始时间 开始时间
B

biyesheng

Unregistered / Unconfirmed
GUEST, unregistred user!
我想用DELPHI调用一个IC卡读卡器的函数接口,但是接口给的是C的格式,又没有给DELPHI<br>调用的例子,我又不太会C,请大家教教我如何调用。<br>函数接口如下:<br>unsigned FAR PASCAL _export CT_reset(int fd);<br>/*参数: fd已打开的端口描述符.<br>&nbsp;*返回: 0x9000 成功<br>&nbsp;* &nbsp; &nbsp; &nbsp;0xffff 通迅失败<br><br>unsigned FAR PASCAL _export ICC_reset(int fd,char far *len,char far *resp);<br>/*参数: fd &nbsp; :已打开的端口描述符.<br>&nbsp;* &nbsp; &nbsp; &nbsp;len &nbsp;:为对IC卡复位所返回的复位数据的长度<br>&nbsp;* &nbsp; &nbsp; &nbsp;resp :为复位的数据结果<br>&nbsp;*返回: 0x9000 成功<br>&nbsp;* &nbsp; &nbsp; &nbsp;0x6200 无卡<br>&nbsp;* &nbsp; &nbsp; &nbsp;0x6201 协议不认识<br>&nbsp;* &nbsp; &nbsp; &nbsp;0xffff 通迅失败<br><br>unsigned FAR PASCAL _export ICC_tsi_api(int fd,unsigned char len, &nbsp;<br>char far *comm,unsigned char far *lenr,char far *resp);<br>/*参数: fd &nbsp; &nbsp; : 已打开的端口描述符.<br>&nbsp;* &nbsp; &nbsp; &nbsp;len &nbsp; &nbsp;: 命令comm的长度<br>&nbsp;* &nbsp; &nbsp; &nbsp;comm &nbsp; : 发向卡上的命令<br>&nbsp;* &nbsp; &nbsp; &nbsp;lenr &nbsp; : 从卡上接收到的数据长度<br>&nbsp;* &nbsp; &nbsp; &nbsp;resp &nbsp; : 从卡上接收到的数据<br>&nbsp;*返回: 0xffff通迅失败(发送命令或接收返回的数据失败.
 
function CT_reset(fd: Integer): word; stdcall;<br>/*参数: fd已打开的端口描述符.<br>&nbsp;*返回: 0x9000 成功<br>&nbsp;* &nbsp; &nbsp; &nbsp;0xffff 通迅失败<br><br>function ICC_reset(fd: Integer,var len: Byte; resp: PChar): Word; stdcall;<br>/*参数: fd &nbsp; :已打开的端口描述符.<br>&nbsp;* &nbsp; &nbsp; &nbsp;len &nbsp;:为对IC卡复位所返回的复位数据的长度<br>&nbsp;* &nbsp; &nbsp; &nbsp;resp :为复位的数据结果<br>&nbsp;*返回: 0x9000 成功<br>&nbsp;* &nbsp; &nbsp; &nbsp;0x6200 无卡<br>&nbsp;* &nbsp; &nbsp; &nbsp;0x6201 协议不认识<br>&nbsp;* &nbsp; &nbsp; &nbsp;0xffff 通迅失败<br><br>function ICC_tsi_api(fd: Integer, len: Byte, &nbsp;<br>comm: PChar, lenr: PByte, resp: PChar): Word; stdcall;<br>/*参数: fd &nbsp; &nbsp; : 已打开的端口描述符.<br>&nbsp;* &nbsp; &nbsp; &nbsp;len &nbsp; &nbsp;: 命令comm的长度<br>&nbsp;* &nbsp; &nbsp; &nbsp;comm &nbsp; : 发向卡上的命令<br>&nbsp;* &nbsp; &nbsp; &nbsp;lenr &nbsp; : 从卡上接收到的数据长度<br>&nbsp;* &nbsp; &nbsp; &nbsp;resp &nbsp; : 从卡上接收到的数据<br>&nbsp;*返回: 0xffff通迅失败(发送命令或接收返回的数据失败.
 
好像有点问题。好像不能这样直接“翻译”吧?
 
多人接受答案了。
 
后退
顶部