Einzelnen Beitrag anzeigen

GreenHorn3600

Registriert seit: 24. Jun 2007
165 Beiträge
 
#3

Re: OnTerminate wird nicht ausgeführt

  Alt 15. Aug 2009, 14:13
Hallo Fabian,

nichts besonderes, er ruft den Download auf und macht eine Fehlerbehandlung.

Delphi-Quellcode:
procedure TWUSDownloadThread.Execute;
begin
  try
    if (fURL <> '') and (FFilename <> '') then Download;
  except
    if not(ExceptObject is EAbort) then
      Synchronize(self, ShowException);
  end;
end;
Der Download sieht folgendermaßen aus:
Delphi-Quellcode:
procedure TWUSDownloadThread.Download;
var
  URLDown: TDownLoadURL;
begin
  URLDown := TDownLoadURL.Create(NIL);
  try
    URLDown.Filename := FFilename;
    URLDown.URL := FURL;
    URLDown.OnDownloadProgress := DownloadProgress;
    URLDown.ExecuteTarget(NIL);
  finally
    URLDown.Free;
  end;
  if fHasDownloaded then
    terminate;
end;
Wobei das Flag HasDownloaded wunderbar auf True gesetzt ist, und Terminate aufgerufen wird.

Weiss wirklich nicht, an was es liegen könnt...

Greeny
  Mit Zitat antworten Zitat