unit DDownloader; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, zkemkeeper_TLB, XPMan, ComCtrls, StdCtrls; type TFMain = class(TForm) Label1: TLabel; lbNetAddress: TLabel; Label4: TLabel; lbStatus: TLabel; Label6: TLabel; lbDevStatus: TLabel; Label8: TLabel; lbTotalDatos: TLabel; Label2: TLabel; lbPercent: TLabel; Label3: TLabel; lbModel: TLabel; Button2: TButton; Button3: TButton; Button4: TButton; pbProgreso: TProgressBar; sbInfo: TStatusBar; XPManifest1: TXPManifest; private { Private declarations } public { Public declarations } end; TDataDown = class(TThread) private { Private declarations } DevID: Integer; ZK: TCZKEM; strFirmWare: WideString; Connected: Boolean; FPercent: WideString; protected procedure Execute; override; procedure MostrarProgreso; override; public { Public declarations } IPAddress: WideString; end; var FMain: TFMain; implementation {$R *.dfm} procedure TDataDown.Execute; var i: Integer; dwEnrollNumber,dwModel: widestring; dwYear,dwMonth,dwDay,dwHour,dwMinute,dwSecond: Integer; dwVerifyMode,dwInOutMode,dwWorkCode: integer; s: string; f: TFileStream; Data: TStringList; Connect: Boolean; ErrorCode: Integer; Fecha: TDateTime; begin Connect := ZK.Connect_Net(IPAddress,4370); DevID := 1; ZK.GetFirmwareVersion(DevID, strFirmWare); ZK.GetProductCode(DevID,dwModel); FMain.lbModel.Caption := dwModel; FMain.sbInfo.Panels[1].Text := 'Firm Version: '+strFirmWare; if Connect then Begin Connected := True; FMain.lbDevStatus.Caption := 'Activo'; Data := TStringList.Create; f := TFileStream.Create(ExtractFilePath(Application.ExeName)+ FormatDateTime('yy-mm-dd',Now)+'.D1', fmOpenWrite or fmCreate); try Data.Clear; FMain.lbStatus.Caption := 'Trabajando...'; if ZK.ReadAllGLogData(DevId) then while ZK.SSR_GetGeneralLogData(DevId,dwEnrollNumber,dwVerifyMode,dwInOutMode, dwYear,dwMonth,dwDay,dwHour,dwMinute,dwSecond,dwWorkCode) do begin ShortDateFormat := 'yyyy/mm/dd'; ShortTimeFormat := 'hh:mm'; TimeSeparator := ':'; DateSeparator := '/'; Fecha := StrToDateTime(IntToStr(dwYear)+'/'+IntToStr(dwMonth)+'/'+IntToStr(dwDay)+' '+IntToStr(dwHour)+':'+IntToStr(dwMinute)); s := format('%.*d',[7,StrToInt(dwEnrollNumber)])+'>'+FormatDateTime('yyyy/mm/dd', Fecha)+':'+FormatDateTime('hh:mm', Fecha) + Char(#13) + Char(#10); Data.Add(s); end; if (Data.Count > 0) then begin FMain.lbTotalDatos.Caption := IntToStr(Data.Count); FMain.pbProgreso.Max := Data.Count; for I := 0 to Data.Count - 1 do begin if Terminated then Exit; FPercent := FloatToStr((Data.IndexOf(Data.Strings[i]) * 100) / Data.Count)+'%'; f.WriteBuffer(Data.Strings[i][1], Length(Data.Strings[i])); Synchronize(MostrarProgreso); end; end else ShowMessage('No Hay datos que descargar!.'); finally Data.Free; f.Free; Connected := False; end; End else begin Connected := False; ZK.GetLastError(ErrorCode); FMain.lbDevStatus.Caption := 'Inactivo'; FMain.lbStatus.Caption := 'Esperando...'; FMain.lbTotalDatos.Caption := '0'; ShowMessage('Ha Ocurrido un Problema!. Error No.: '+IntToStr(Errorcode)); end; FMain.lbTotalDatos.Caption := '0'; FMain.lbStatus.Caption := 'Esperando...'; FMain.lbDevStatus.Caption := 'Inactivo'; ZK.Disconnect; end; procedure TDataDown.MostrarProgreso; begin FMain.lbPercent.Caption := FPercent; end; end.
Como verán TDataDown es el hilo que estoy creando y ella tiene dos métodos, Execute y MostrarProgreso, pues bien, al querer compilar el proyecto me da el siguiente error:
[Error] DDownloader.pas(45): Method 'MostrarProgreso' not found in base class
Donde estoy fallando???
Saludos.