//ByValue在Delphi是什么类型我也不是很清楚//没有玩过VBfunction read_card(hiCC: Word; zone: Word; addr: Word; data_len: Word; Buffer: PChar): Integer; external 'STICCW32.DLL';
//Declare Function read_card Lib "STICCW32.DLL" (ByVal hiCC%, ByVal zone%, ByVal addr%, ByVal data_len%, ByVal dat$) As Integer
function check_code(hiCC: Word; code_length: Word; code: Byte): Integer; external 'STICCW32.DLL';
//Declare Function check_code Lib "STICCW32.DLL" (ByVal hiCC%, ByVal code_length%, code As Byte) As Integerprocedure TForm1.Button1Click(Sender: TObject);
//Private Sub Command10_Click()
var
yOde: array[0..3] of Byte;
//Dim yOde(4) As Byte
nstatus: Integer;
nhiCC: Integer;
begin
yOde[0] := $FF;
//yOde(0) = &HFF
yOde[1] := $FF;
//yOde(1) = &HFF
yOde[2] := $FF;
//yOde(2) = &HFF
nstatus := check_code(nhiCC, 3, yOde[0]);
//nstatus% = check_code(nhiCC, 3, yOde(0))
if nstatus = 0 then
//If nstatus = 0 Then
ShowMessage('OK');
//MsgBox "ok"
//End If
end;
//End Subprocedure TForm1.Button2Click(Sender: TObject);
//Private Sub Command7_Click()
var
sss: array[0..20]of Char;
//Dim sss As String * 20
nstatus: Integer;
nhiCC: Integer;
begin
nstatus := read_card(nhiCC, 0, 32, 10, sss);
//nstatus% = read_card(nhiCC, 0, 32, 10, sss)
if nstatus = 0 then
//If nstatus = 0 Then
Edit1.Text := sss
// Text1.Text = sss
else Edit1.Text := IntToStr(nstatus);
//Else
// Text1.Text = CStr(nstatus)
//End If
end;
//End Sub
//Declare Function read_card Lib "STICCW32.DLL" (ByVal hiCC%, ByVal zone%, ByVal addr%, ByVal data_len%, ByVal dat$) As Integer
function check_code(hiCC: Word; code_length: Word; code: Byte): Integer; external 'STICCW32.DLL';
//Declare Function check_code Lib "STICCW32.DLL" (ByVal hiCC%, ByVal code_length%, code As Byte) As Integerprocedure TForm1.Button1Click(Sender: TObject);
//Private Sub Command10_Click()
var
yOde: array[0..3] of Byte;
//Dim yOde(4) As Byte
nstatus: Integer;
nhiCC: Integer;
begin
yOde[0] := $FF;
//yOde(0) = &HFF
yOde[1] := $FF;
//yOde(1) = &HFF
yOde[2] := $FF;
//yOde(2) = &HFF
nstatus := check_code(nhiCC, 3, yOde[0]);
//nstatus% = check_code(nhiCC, 3, yOde(0))
if nstatus = 0 then
//If nstatus = 0 Then
ShowMessage('OK');
//MsgBox "ok"
//End If
end;
//End Subprocedure TForm1.Button2Click(Sender: TObject);
//Private Sub Command7_Click()
var
sss: array[0..20]of Char;
//Dim sss As String * 20
nstatus: Integer;
nhiCC: Integer;
begin
nstatus := read_card(nhiCC, 0, 32, 10, sss);
//nstatus% = read_card(nhiCC, 0, 32, 10, sss)
if nstatus = 0 then
//If nstatus = 0 Then
Edit1.Text := sss
// Text1.Text = sss
else Edit1.Text := IntToStr(nstatus);
//Else
// Text1.Text = CStr(nstatus)
//End If
end;
//End Sub
解决方案 »
- 问一个关于DELPHI中数组的问题
- 简单问题(30分)
- 字符串问题
- 急!急!怎样清理DLL中无用的资源呀?
- SpCommm串口 有的时候会没有响应 还有的时候诊听到的数据 是很混乱的为什么啊!
- 急需interbase,请问我应该去哪里下载丫,谢谢!
- 紧急求助!关于dbcombobox
- 如何用Winsock API发送邮件(支持SMTP身份验证)
- 怎样改变messagebox输出的对话框中的按钮上的文字?一定给分!
- 在table中有cachedupdates可实现用applyupdate最后统一作保存。但好像adotable中没有这项属性了,请问大哥们在ADO中怎样才可以实现相同的功能
- 寻visibroker 4.1 for c++(Delphi 6.0自带的)的注册码
- 集思广益,如何保护注册表不被修改?
//Declare Function read_card Lib "STICCW32.DLL" (ByVal hiCC%, ByVal zone%, ByVal addr%, ByVal data_len%, ByVal dat$) As Integer
function check_code(var hiCC: Integer; var code_length: Integer; code: Byte): Integer; external 'STICCW32.DLL';
//Declare Function check_code Lib "STICCW32.DLL" (ByVal hiCC%, ByVal code_length%, code As Byte) As Integer
//Declare Function read_card Lib "STICCW32.DLL" (ByVal hiCC%, ByVal zone%, ByVal addr%, ByVal data_len%, ByVal dat$) As Integer
function check_code(var hiCC: Integer; var code_length: Integer; code: Byte): Integer; external 'STICCW32.DLL'; stdcall;
//Declare Function check_code Lib "STICCW32.DLL" (ByVal hiCC%, ByVal code_length%, code As Byte) As Integer
Declare Function write_card Lib "STICCW32.DLL" (ByVal hiCC%, ByVal zone%, ByVal addr%, ByVal data_len%, ByVal dat$) As IntegerPrivate Sub Command8_Click()
Dim sTmp As String
sTmp = Trim(Text7.Text)
nstatus% = write_card(nhiCC, 0, 32, 10, sTmp)
If nstatus = 0 Then
MsgBox "OK!"
Else
MsgBox "error!"
End If
end sub
出错的原因在于不知sTmp变量为什么类型?以及dll文件函数中的dat为何类型?