Caro amigos, Gostarias da ajudar de vcs. A questão é a seguinte tenho dois forms, um é pra cadastrar a digital e o outro é pra verificar a digital cadastrada. A tela que cadastra a dital e tal está funcionando normal, mas a tela que faz a verificação da digital salva no banco de dados não está funcionando, tipo, ela não chama a a função de verifição. Estou enviando o código para ver onde eu estou errando:
====================================================================== unit verificadigital; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, StdCtrls, DBCtrls, DB, DBTables; Const // Constant for Basic SecuBSP_FALSE = 0; SecuBSP_TRUE = 1; //Constant for Error SecuBSPERROR_BASE_GENERAL = 0; SecuBSPERROR_BASE_DEVICE = 4096; SecuBSPERROR_BASE_UI = 8192; SecuBSPERROR_NONE = 0; SecuBSPERROR_INVALID_HANDLE = SecuBSPERROR_BASE_GENERAL + 16; SecuBSPERROR_INVALID_POINTER = SecuBSPERROR_BASE_GENERAL + 32; SecuBSPERROR_INVALID_TYPE = SecuBSPERROR_BASE_GENERAL + 48; SecuBSPERROR_FUNCTION_FAIL = SecuBSPERROR_BASE_GENERAL + 64; SecuBSPERROR_STRUCTTYPE_NOT_MATCHED = SecuBSPERROR_BASE_GENERAL + 80; SecuBSPERROR_ALREADY_PROCESSED = SecuBSPERROR_BASE_GENERAL + 96; SecuBSPERROR_EXTRACTION_OPEN_FAIL = SecuBSPERROR_BASE_GENERAL + 112; SecuBSPERROR_VERIFICATION_OPEN_FAIL = SecuBSPERROR_BASE_GENERAL + 128; SecuBSPERROR_DATA_PROCESS_FAIL = SecuBSPERROR_BASE_GENERAL + 144; SecuBSPERROR_MUST_BE_PROCESSED_DATA = SecuBSPERROR_BASE_GENERAL + 160; SecuBSPERROR_INTERNAL_CHECKSUM_FAIL = SecuBSPERROR_BASE_GENERAL + 176; SecuBSPERROR_ENCRYPTED_DATA_ERROR = SecuBSPERROR_BASE_GENERAL + 192; SecuBSPERROR_INIT_MAXFINGER = SecuBSPERROR_BASE_GENERAL + 256; SecuBSPERROR_INIT_SAMPLESPERFINGER = SecuBSPERROR_BASE_GENERAL + 272; SecuBSPERROR_INIT_ENROLLQUALITY = SecuBSPERROR_BASE_GENERAL + 288; SecuBSPERROR_INIT_VERIFYQUALITY = SecuBSPERROR_BASE_GENERAL + 304; SecuBSPERROR_INIT_IDENTIFYQUALITY = SecuBSPERROR_BASE_GENERAL + 320; SecuBSPERROR_INIT_SECURITYLEVEL = SecuBSPERROR_BASE_GENERAL + 336; SecuBSPERROR_DEVICE_OPEN_FAIL = SecuBSPERROR_BASE_DEVICE; SecuBSPERROR_INVALID_DEVICE_ID = SecuBSPERROR_BASE_DEVICE + 16; SecuBSPERROR_WRONG_DEVICE_ID = SecuBSPERROR_BASE_DEVICE + 32; SecuBSPERROR_DEVICE_ALREADY_OPENED = SecuBSPERROR_BASE_DEVICE + 48; SecuBSPERROR_DEVICE_NOT_OPENED = SecuBSPERROR_BASE_DEVICE + 64; SecuBSPERROR_DEVICE_BRIGHTNESS = SecuBSPERROR_BASE_DEVICE + 80; SecuBSPERROR_DEVICE_CONTRAST = SecuBSPERROR_BASE_DEVICE + 96; SecuBSPERROR_DEVICE_GAIN = SecuBSPERROR_BASE_DEVICE + 112; SecuBSPERROR_USER_CANCEL = SecuBSPERROR_BASE_UI + 16; //Constant for Security Level SecuBSP_FIR_SECURITY_LEVEL_LOWEST = 1; SecuBSP_FIR_SECURITY_LEVEL_LOWER = 2; SecuBSP_FIR_SECURITY_LEVEL_LOW = 3; SecuBSP_FIR_SECURITY_LEVEL_BELOW_NORMAL = 4; SecuBSP_FIR_SECURITY_LEVEL_NORMAL = 5; SecuBSP_FIR_SECURITY_LEVEL_ABOVE_NORMAL = 6; SecuBSP_FIR_SECURITY_LEVEL_HIGH = 7; SecuBSP_FIR_SECURITY_LEVEL_HIGHER = 8; SecuBSP_FIR_SECURITY_LEVEL_HIGHEST = 9; //Constant for Device Name SecuBSP_DEVICE_NAME_FDP02 = 1; SecuBSP_DEVICE_NAME_FDU01 = 2; //Constant for DeviceID SecuBSP_DEVICE_ID_NONE = 0; SecuBSP_DEVICE_ID_FDP02_0 = 1; SecuBSP_DEVICE_ID_FDU01_0 = 2; SecuBSP_DEVICE_ID_AUTO_DETECT = 255; type Tdigital = class(TForm) Label1: TLabel; matricula: TEdit; DBGrid1: TDBGrid; Label2: TLabel; DBText1: TDBText; Table1: TTable; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure matriculaKeyPress(Sender: TObject; var Key: Char); procedure FormKeyPress(Sender: TObject; var Key: Char); private { Private declarations } public { Public declarations } end; var digital: Tdigital; implementation uses Utabelas, Comobj; var nDeviceID : longint; objSecuBsp : variant; //szFIRTextData : wideString; {$R *.dfm} procedure Tdigital.FormCreate(Sender: TObject); begin objSecuBsp := CreateOleObject('SecuBSPCOM.APIInterface'); objSecuBSP.EnumerateDevice; end; procedure Tdigital.FormClose(Sender: TObject; var Action: TCloseAction); var iDeviceID:integer; begin iDeviceID := SecuBSP_DEVICE_ID_AUTO_DETECT; objSecuBSP.CloseDevice(iDeviceID); objSecuBSP :=null; end; procedure Tdigital.matriculaKeyPress(Sender: TObject; var Key: Char); var ret : Integer; szFIRTextData: String; begin if(key=#13) then begin if( matricula.Text='') then begin showmessage('Por favor entre com com uma Matrícula Válida'); matricula.SetFocus; exit; end; if (tabelas.acesso.Locate('MATRICULA',matricula.Text,[locaseinsensitive])=true) then begin if(tabelas.acesso.FieldByName('DIGITAL').AsString='') then begin showmessage('NÃO HÁ DIGITA CADASTRADA!!!'); exit; end; end; szFIRTextData:=tabelas.acesso.fieldbyname('DIGITAL').AsString; ret:=objSecuBSP.Verify(szFIRTextData); if( tabelas.acesso.fieldbyname('DIGITAL').asstring = inttostr(ret) ) then begin showmessage('Perfeito!'); end; end else begin showmessage('NÃO EXISTE ESSA MATRICULA CADASTRADA!'); matricula.Clear; matricula.SetFocus; EXIT; end; end; end; procedure Tdigital.FormKeyPress(Sender: TObject; var Key: Char); begin if(key=#27) then begin close; end; end; end.