Ver Mensaje Individual
  #18  
Antiguo 26-02-2019
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Reputación: 20
oscarac Va por buen camino
Código Delphi [-]
unit FrmMain_f;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Grids, Vcl.DBGrids, zkemkeeper_TLB, dateutils,
  Vcl.OleCtrls;

type
  TForm1 = class(TForm)
    edtIp: TEdit;
    edtPort: TEdit;
    btnDispositivoLoad: TButton;
    dbgrd1: TDBGrid;
    mmoLOG: TMemo;
    lbl1: TLabel;
    procedure btnDispositivoLoadClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
//    Procedure LeerHuella (sender: tobject; EnrollNumber, IsInValid, AttState,
//      VerifyMethod, Year, Month, Day, Hour, Minute, Second: integer);

    Procedure CapturaCodigo (sender: tobject; EnrollNumber : String; IsInvalid, AttState, VerifyMethod, year, Month, Day, hour, Minute, Second : Integer);
  private

    { Private declarations }
  public
      ZK1 : TCZKEM;
      Connected : Boolean;
      procedure OnConnect(Sender : TObject);
      procedure OnDisconnect(Sender : TObject);
      function CapturaRegistros : Boolean;
      procedure Log(aMsj : string);
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btnDispositivoLoadClick(Sender: TObject);
begin

  if not(ZK1.Connect_Net(EdtIP.Text, StrToInt(EdtPort.Text))) then
    begin
      lbl1.Caption := 'Error. No se pudo conectar';
      exit;
    end;
    if not ZK1.RegEvent(1, 65535) then  //65535
      lbl1.Caption := 'Error RegEvent';

    ZK1.PullMode := 1;

      Log('Conectado...');


end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ZK1 := TCZKEM.Create(nil);
  ZK1.OnConnected := OnConnect;
  ZK1.OnAttTransaction := CapturaCodigo;
//  aqui me sale error
[dcc32 Error] FrmMain_f.pas(68): E2010 Incompatible types: 'Integer' and 'string'
end;

procedure TForm1.OnConnect(Sender: TObject);
begin
  Connected := True;
end;

procedure TForm1.OnDisconnect(Sender: TObject);
begin
  Connected := False;
end;


Procedure TForm1.CapturaCodigo (sender: tobject; EnrollNumber : String; IsInvalid, AttState, VerifyMethod, year, Month, Day, hour, Minute, Second : Integer);
Var _Resultado : Integer;   //EnrollNumber, IsInvalid, AttState, VerifyMethod, year, Month, Day, hour, Minute, Second : Integer;
begin
      Log('Entro a Leer huella');
    _Resultado := ZK1.OnAttTransactionEx (sender, EnrollNumber, IsInvalid, AttState, VerifyMethod, year, Month, Day, hour, Minute, Second);
// aqui debo jalar el codigo que se almacena en la variable EnrollNumber
end;

procedure TForm1.Log(aMsj: string);
begin
  MmoLOG.Lines.Add(aMsj);
end;

end.
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita