Dll中申明函数原型:
C语言申明
int WINAPI rfReader_M1_read(long ReaderHandle,unsigned short icdev, unsigned char KeyA_B, unsigned char block, unsigned char * key, unsigned char *pData);
VB调用如下:
Dim TF As Long '返回标志
Dim bySourByte(256) As Byte
Dim szDestString(256) As Byte
Dim strbuf As String * 256
Dim strbuf1 As String * 256
strbuf1 ="FFFFFFFFFFFF"
Call StringToByte(strbuf1, 12, szDestString(0))
TF = rfReader_M1_read(RHandle, 0, 0, 4, szDestString(0), bySourByte(0))我在Delphi申明如下:
function rfReader_M1_read(ReaderHandle:LongInt;icdev:Word;KeyA_B:Byte;block:Byte;key,pSnr:pchar):Integer;stdcall;external 'MifareOne.dll';
怎么样把它翻译成Delphi语言,谢谢!
C语言申明
int WINAPI rfReader_M1_read(long ReaderHandle,unsigned short icdev, unsigned char KeyA_B, unsigned char block, unsigned char * key, unsigned char *pData);
VB调用如下:
Dim TF As Long '返回标志
Dim bySourByte(256) As Byte
Dim szDestString(256) As Byte
Dim strbuf As String * 256
Dim strbuf1 As String * 256
strbuf1 ="FFFFFFFFFFFF"
Call StringToByte(strbuf1, 12, szDestString(0))
TF = rfReader_M1_read(RHandle, 0, 0, 4, szDestString(0), bySourByte(0))我在Delphi申明如下:
function rfReader_M1_read(ReaderHandle:LongInt;icdev:Word;KeyA_B:Byte;block:Byte;key,pSnr:pchar):Integer;stdcall;external 'MifareOne.dll';
怎么样把它翻译成Delphi语言,谢谢!
解决方案 »
- Delphi2007与无BOMUTF8
- dbgrid导入数据库代码分析
- 这个sql语句怎么写啊
- 郁闷,装个Fastreport2.53,一直弹不出预览窗口??
- 有个字段不知道怎么设计好?
- ◢█◤★ 急求横向滚动的字幕控件 ★◢█◤
- websnap 中用户之间如何协调数据集?
- 我想知道DELPHI自带的例程都是干什么的
- 谁能告诉我一个delphi6的下载地址,我用http下载如果好用马上给分。在线等待!
- delphi读注册表的问题,Thank you!
- 请问set nocount off 和 set nocount on 有什么用
- 动态建立fastreport报表时,如何添加动态创建的MEMO的OnBeforePrint事件?
procedure StringToByte(pBuf: PChar; nLen: integer; pDest: array of Byte);
var
nLBound: integer;
nUBound: integer;
i: integer;
begin
nLBound := Low(pDest);
nUBound := High(pDest);
If(nLen > nUBound - nLBound) Then
nLen := nUBound - nLBound;
for i := 0 to nLen do
pDest[i + nLBound] := Ord(pBuf[i]);
end;
var
TF: longint;
bySourByte: array[0..256] of Byte;
szDestString: array[0..256] of Byte;
strbuf: array[0..256] of char;
strbuf1: array[0..256] of char;
RHandle: LongInt;
begin
StrPCopy(strbuf1, 'FFFFFFFFFFFF');
StringToByte(strbuf1, 12, szDestString);
TF := rfReader_M1_read(RHandle, 0, 0, 4, @szDestString, @bySourByte);
end;