我要调用dephi编写的动态连接库mjSDKDLL.dll的其中一个函数function GetRecord(comport: integer; CtrlNo: string): TCardinfo;
说明:得到脱机门禁纪录,传入参数为通信端口号、控制器编号
举例:
procedure TForm2.SpeedButton2Click(Sender: TObject);
var
count_jl, i: integer;
ctrlno: string; //控制器号;
cardinfo: TCardInfo;
status: TControl;
begin
Timer1.Enabled := false;
sleep(500);
case length(edit1.text) of
1: ctrlno := '000' + edit4.text;
2: ctrlno := '00' + edit4.text;
3: ctrlno := '0' + edit4.text;
4: ctrlno := edit4.text;
end;
status := GetControlStatus(comport, ctrlno);
for i := 0 to status.RecordCount do
begin
application.ProcessMessages;
application.ProcessMessages;
application.ProcessMessages;
application.ProcessMessages;
label6.Caption := inttostr(i);
cardinfo := getrecord(comport, ctrlno);
if cardinfo.i_result > 0 then
begin
stringgrid2.Cols[0][i + 1] := cardinfo.t_cardno;
stringgrid2.Cols[1][i + 1] := cardinfo.block_code;
stringgrid2.Cols[2][i + 1] := cardinfo.t_intime;
stringgrid2.Cols[3][i + 1] := inttostr(i + 1);
//showmessage(inttostr(cardinfo.recordcount));
end;
end;end;最好能有个例子, 谢谢各位!
说明:得到脱机门禁纪录,传入参数为通信端口号、控制器编号
举例:
procedure TForm2.SpeedButton2Click(Sender: TObject);
var
count_jl, i: integer;
ctrlno: string; //控制器号;
cardinfo: TCardInfo;
status: TControl;
begin
Timer1.Enabled := false;
sleep(500);
case length(edit1.text) of
1: ctrlno := '000' + edit4.text;
2: ctrlno := '00' + edit4.text;
3: ctrlno := '0' + edit4.text;
4: ctrlno := edit4.text;
end;
status := GetControlStatus(comport, ctrlno);
for i := 0 to status.RecordCount do
begin
application.ProcessMessages;
application.ProcessMessages;
application.ProcessMessages;
application.ProcessMessages;
label6.Caption := inttostr(i);
cardinfo := getrecord(comport, ctrlno);
if cardinfo.i_result > 0 then
begin
stringgrid2.Cols[0][i + 1] := cardinfo.t_cardno;
stringgrid2.Cols[1][i + 1] := cardinfo.block_code;
stringgrid2.Cols[2][i + 1] := cardinfo.t_intime;
stringgrid2.Cols[3][i + 1] := inttostr(i + 1);
//showmessage(inttostr(cardinfo.recordcount));
end;
end;end;最好能有个例子, 谢谢各位!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货