Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #21  
Antiguo 27-02-2019
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Poder: 20
oscarac Va por buen camino
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
Algunas consideraciones...


1) Los procedimientos definidos, colócalos dentro de la parte privada.
Código Delphi [-]
   ...

    dbgrd1: TDBGrid;
    mmoLOG: TMemo;
    lbl1: TLabel;
  private

    procedure FormCreate(Sender: TObject);
    procedure LeerHuella(Sender: Tobject);

    procedure AttTransactionProc(ASender: TObject; EnrollNumber: Integer; IsInValid: Integer;
                                 AttState: Integer; VerifyMethod: Integer;
                                 Year: Integer; Month: Integer; Day: Integer;
                                 Hour: Integer; Minute: Integer;
                                 Second: Integer);
    procedure GeneralEventProc(ASender: TObject; const DataStr: WideString);
  public


2) Define un par más para ver otros eventos:
Código Delphi [-]
    procedure AttTransactionProc(ASender: TObject; EnrollNumber: Integer; IsInValid: Integer;
                                 AttState: Integer; VerifyMethod: Integer;
                                 Year: Integer; Month: Integer; Day: Integer;
                                 Hour: Integer; Minute: Integer;
                                 Second: Integer);
    procedure GeneralEventProc(ASender: TObject; const DataStr: WideString);


3) Añade la implementación con el Log.
Código Delphi [-]
procedure TForm1.GeneralEventProc(ASender: TObject; const DataStr: WideString);
begin
  Log('TForm1.GeneralEventProc');
  Log('  - DataString: ' + DataStr);
end;

procedure TForm1.AttTransactionProc(ASender: TObject; EnrollNumber, IsInValid,
  AttState, VerifyMethod, Year, Month, Day, Hour, Minute, Second: Integer);
begin
  Log('TForm1.AttTransactionProc');
  Log('  - EnrollNumber: ' + IntToStr(EnrollNumber));
  Log('  - IsInValid: ' + IntToStr(IsInValid));
  Log('  - AttState: ' + IntToStr(AttState));
  Log('  - VerifyMethod: ' + IntToStr(VerifyMethod));
  Log('  - Year: ' + IntToStr(Year));
  Log('  - Month: ' + IntToStr(Month));
  Log('  - Day: ' + IntToStr(Day));
  Log('  - Hour: ' + IntToStr(Hour));
  Log('  - Minute: ' + IntToStr(Minute));
  Log('  - Second: ' + IntToStr(Second));
end;


4) Y asignalos todos en la creación del componente:
Código Delphi [-]
...

  ZK1 := TCZKEM.Create(nil);
  ZK1.OnConnected := OnConnect;
  ZK1.OnFinger := LeerHuella;
  ZK1.OnDisConnected := OnDisconnect;
  ZK1.OnAttTransaction := AttTransactionProc;
  ZK1.OnGeneralEvent := GeneralEventProc;


Por último, estaría bien que nos pusieras la salida del Log, cuando ejecutas y cuando pones el dedo en el lector.
la idea es que yo declaro un procedimiento para cuando se dispare un evento, eso lo tengo clarisimo, pero me esta saliendo un error cuando defino el procedimiento

Código Delphi [-]
[dcc32 Error] FrmMain_f.pas(22): E2065 Unsatisfied forward or external declaration: 'TForm1.AttTransactionProc'
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Interceptar DBEdit ecfisa OOP 3 01-07-2008 11:57:34
Interceptar post.... brandolin Varios 1 29-08-2007 15:23:47
Interceptar impresión Walcasar Impresión 0 19-10-2006 15:22:20
Interceptar DBNavigator dape Conexión con bases de datos 1 09-04-2005 18:36:16
interceptar error edfz Conexión con bases de datos 2 08-04-2004 01:12:28


La franja horaria es GMT +2. Ahora son las 04:24:17.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi