Einzelnen Beitrag anzeigen

asdfg
(Gast)

n/a Beiträge
 
#1

URL_OnDownloadProgress wird nicht ausgeführt

  Alt 22. Okt 2005, 20:24
Hi,

mein Problem ist, wenn ich versuche den Code zu kompilieren kommt folgender Fehler:
Zitat:
[Fehler] Unit1.pas(144): Inkompatible Typen: 'Liste der Parameter ist unterschiedlich'
Zeile 144 ist folgendes: OnDownloadProgress := URL_OnDownloadProgress; Wenn ich diese Zeile einkommentiere kann man den Code zwar kompilieren, aber URL_OnDownloadProgress wird nicht ausgeführt. So habe ich diese Funktion deklariert:

Zitat:
procedure URL_OnDownloadProgress(Sender: TDownLoadURL;
Progress, ProgressMax: Cardinal;
StatusCode: TURLDownloadStatus;
var Cancel: Boolean);
Delphi-Quellcode:
procedure Tform1.URL_OnDownloadProgress;
begin
  case StatusCode of
    dsFINDINGRESOURCE:
      Label3.Caption := 'Downloadstatus: Datei wurde gefunden...';
    dsCONNECTING:
      Label3.Caption := 'Downloadstatus: Es wird verbunden...';
    dsBEGINDOWNLOADDATA:
      Label3.Caption := 'Downloadstatus: Der Download wird gestartet...';
    dsDOWNLOADINGDATA:
      begin
        ProgressBar.Max:= ProgressMax;
        ProgressBar.Position:= Progress;
        Label3.Caption := 'Downloadstatus: Datei wird heruntergeladen...';
      end;
    dsENDDOWNLOADDATA:
      begin
        Memo2.Lines.Add(get_date() + 'Datei erfolgreich heruntergeladen!');
        ProgressBar.Position := 0;
      end;
  end;
  Application.ProcessMessages;
end;

procedure Tform1.download_file(dl_url,localfile : string);
begin
 with TDownloadURL.Create(nil) do
  try
    URL := dl_url;
    FileName := localfile;
    OnDownloadProgress := URL_OnDownloadProgress;
    ExecuteTarget(nil);
  finally
    Free;
  end;
end;
  Mit Zitat antworten Zitat