Registriert seit: 26. Mai 2004
3.159 Beiträge
|
AW: Prozedur mit Parametern an Thread übergeben
23. Mär 2011, 17:34
Delphi-Quellcode:
TReportThread = class(TThread)
public type
TThreadedProc: procedure(const AInt: Integer; const AStr: String) of object;
private
FParam1 : Integer;
FParam2 : String;
FProc : TThreadedProc;
protected
procedure Execute(); override;
public
property Param1 : Integer read FParam1 write FParam1;
property Param2 : String read FParam2 write FParam2;
property Proc : TThreadedProc read FProc write FProc;
end;
procedure TReportThread.Execute();
begin
try
Proc(FParam1, FParam2);
except
end;
end;
»Remember, the future maintainer is the person you should be writing code for, not the compiler.« (Nick Hodges)
|