Hi.
Danke für die Begrüßung

.
Also der Code ist im Grunde genommen haargenau gleich wie im Beispiel, aber hier ist er nochmal

:
In Reihenfolge mal alles das was ich als wichtig erachte:
Code:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Psock, NMHttp, inifiles, ComCtrls, UrlMon,
ActiveX,
Gauges;
Code:
type
cDownloadStatusCallback = class(TObject,IUnknown,IBindStatusCallback)
private
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
function OnStartBinding(dwReserved: DWORD; pib: IBinding): HResult; stdcall;
function GetPriority(out nPriority): HResult; stdcall;
function OnLowResource(reserved: DWORD): HResult; stdcall;
function OnProgress(ulProgress, ulProgressMax, ulStatusCode: ULONG; szStatusText: LPCWSTR): HResult; stdcall;
function OnStopBinding(hresult: HResult; szError: LPCWSTR): HResult; stdcall;
function GetBindInfo(out grfBINDF: DWORD; var bindinfo: TBindInfo): HResult; stdcall;
function OnDataAvailable(grfBSCF: DWORD; dwSize: DWORD; formatetc: PFormatEtc; stgmed: PStgMedium): HResult; stdcall;
function OnObjectAvailable(const iid: TGUID; punk: IUnknown): HResult; stdcall;
end;
Ist wie gesagt unverändert...
Code:
var
Form1: TForm1;
usercancel: Boolean = False;
Code:
function cDownloadStatusCallback.OnProgress(ulProgress, ulProgressMax, ulStatusCode: ULONG; szStatusText: LPCWSTR): HResult;
begin
case ulStatusCode of
BINDSTATUS_FINDINGRESOURCE:
begin
Form1.Label1.Caption := 'Datei wurde gefunden...';
if (usercancel) then
begin
Result := E_ABORT;
exit;
end;
end;
BINDSTATUS_CONNECTING:
begin
Form1.Label1.Caption := 'Es wird verbunden...';
if (usercancel) then
begin
Result := E_ABORT;
exit;
end;
end;
BINDSTATUS_BEGINDOWNLOADDATA:
begin
Form1.Gauge1.Progress := 0;
Form1.Label1.Caption := 'Der Download wurde gestartet...';
if (UserCancel) then
begin
Result := E_ABORT;
exit;
end;
end;
BINDSTATUS_DOWNLOADINGDATA:
begin
Form1.Gauge1.Progress := MulDiv(ulProgress,100,ulProgressMax);
Form1.Label1.Caption := 'Datei wird heruntergeladen...';
if (UserCancel) then
begin
Result := E_ABORT; exit;
end;
end;
BINDSTATUS_ENDDOWNLOADDATA:
begin
Form1.Label1.Caption := 'Download wurde beendet...';
end;
end;
Application.ProcessMessages;
Result := S_OK;
end;
...und das auch

. Aber wie's aussieht arbeitet das MulDiv nicht... Wenn ich mir das ganze mit IntToStr(MulDiv....) mal testweise in ein Label schreiben lasse, dann steht dort einfach nur 0 .
Code:
if Label3.Caption < Label5.Caption then //das ist eine Art Versionsabgleich
begin
Memo2.Lines.Add('>>Es wurde eine neue Version gefunden!');
cDownStatus := cDownloadStatusCallBack.Create;
try
URLDownloadToFile(nil,'http://www.unsereherren.de/zombienation.wav','C:\test.wav',0,CDownStatus);
finally
cDownStatus.Free;
end;
end;
So, wie man sieht hab ich wirklich so gut wie gar nix geändert, weshalb es mich eigentlich wundert das die Gauge nicht funktionieren will.
C ya!