读书人

急用过二代身份证证阅读器接口的请进

发布时间: 2012-02-20 21:18:24 作者: rapoo

急,用过二代身份证证阅读器接口的,请进!
阅读器的实例是C写的,我转成Delphi后,调用SDT_ReadBaseMsg时就会出错,哪位如做过的,请指点一下
C里面的声明
int SDT_ReadBaseMsg ( int iPort,
unsigned char * pucCHMsg,
unsigned int * puiCHMsgLen,
unsigned char * pucPHMsg,
unsigned int * puiPHMsgLen,
int iIfOpen );
我Delphi里是这么写的
function SDT_ReadBaseMsg(iPort:smallint;
pucCHMsg:array of char;
puiCHMsgLen:array of smallint;
pucPHMsg:array of char;
puiPHMsgLen:array of smallint;
iIfOpen:smallint):smallint;stdcall;external 'sdtapi.dll';

[解决办法]

Delphi(Pascal) code
function SDT_ReadBaseMsg(iPort:Integer;                         pucCHMsg:PChar;                         puiCHMsgLen:PInteger;                         pucPHMsg:PChar;                         puiPHMsgLen:PInteger;                         iIfOpen:Integer):Integer;stdcall;external  'sdtapi.dll';
[解决办法]

function SDT_ReadBaseMsg(iPort:Integer;
pucCHMsg:PChar;
var puiCHMsgLen:Integer; //此处定义成变参更方便一些
pucPHMsg:PChar;
var puiPHMsgLen:Integer;
iIfOpen:Integer):Integer;stdcall;external 'sdtapi.dll';

读书人网 >.NET

热点推荐