Woran genau es hängt, kann ich dir auch nicht sagen, aber das eine oder andere fällt mir schon auf:
1. Globale Variablen (fileinfo, speichernals,runterladen) sind für einen Thread nicht sehr günstig.
2. UpdateForm1 sollte mit Synchronize(UpdateForm1) aufgerufen werden, eben so die einzelnen bezüge auf PagesDlg2, da sie ja nicht zum aktuellen Thread gehören.
3. Du rufst in der Callback DownloadThread auf, eigentlich müsstest du der Callback den aktuellen Thread übergeben, etwa so:
Delphi-Quellcode:
type
cDownloadStatusCallback = class(TObject,IUnknown,IBindStatusCallback)
protected
FDownloadThread : TDownloadThread;
//...
public
constructor Create(ADownloadThread : TDownloadThread);
//...
end;
constructor cDownloadStatusCallback.Create(ADownloadThread : TDownloadThread);
begin
inherited Create;
FDownloadThread := ADownloadThread;
end;
Aufruf mit:
Delphi-Quellcode:
procedure TDownloadThread.DownloadFiles;
var cDownStatus : cDownloadStatusCallback;
begin
cDownStatus := cDownloadStatusCallBack.Create(self);
//...
Aufruf von UpdateForm1 dann so:
FDownloadThread.Synchronize(FDownloadThread.UpdateForm1);