Las mal den Zeiger weg, dann klappt das auch.
Delphi-Quellcode:
type
TDownloadCallBackStatus = procedure(FilesDownloaded: Integer) of object;
Txxx = class(T...)
private
{...}
FDownloadCallBackStatus:TDownloadCallBackStatus;
public
{...}
property OnDownloadCallBackStatus:TDownloadCallBackStatus
read FDownloadCallBackStatus write FDownloadCallBackStatus;
procedure DownloadOrSynchronize(SearchString: string; OnlySync: boolean);
end;
procedure Txxx.DownloadOrSynchronize(SearchString: string; OnlySync: boolean);
var
begin
{...}
if Assigned(FDownloadCallBackStatus) then
FDownloadCallBackStatus(j);
{...}
end;
procedure CallBack(FilesDownloaded: Integer);
begin
MainForm.label_x.Caption := inttostr(FilesDownloaded);
end;
procedure TMainForm.btn_download_click(Sender: TObject);
begin
{...}
AOBJ.OnDownloadCallBackStatus:=CallBack;
AOBJ.DownloadOrSynchronize(edt_tags.Text, chk_nodownload.Checked);
{...}
end;