首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

急用过二代身份证证阅读器接口的,请进!解决方案

2012-02-20 
急,用过二代身份证证阅读器接口的,请进!阅读器的实例是C写的,我转成Delphi后,调用SDT_ReadBaseMsg时就会出

急,用过二代身份证证阅读器接口的,请进!
阅读器的实例是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';

热点排行