Und noch etwas zum ersten Post
Zitat:
Delphi-Quellcode:
function ProgressCallback(Sender: Pointer; Total: Boolean; Value: Int64): HRESULT; stdcall;
begin
BytesCopied := Value; // Test
if Total then
Form1.ProgressBar1.Max := 100
else
Form1.ProgressBar1.Position := GetPercent(BytesToCopy, BytesCopied);
Result := S_OK;
end;
Arch.SetProgressCallback(nil, ProgressCallback);
Rate mal, warum solche Funktionen fast immer sowas wie einen frei benutzbaren "Data"-Parameter besitzen?
Delphi-Quellcode:
function ProgressCallback(Sender: Pointer; Total: Boolean; Value: Int64): HRESULT; stdcall;
begin
//if Total then
// TForm1(Sender).ProgressBar1.Max := 100
//else
// TForm1(Sender).ProgressBar1.Position := GetPercent(BytesToCopy, Value);
if Total then begin
TForm1(Sender).FBytesToCopy := Value;
TForm1(Sender).ProgressBar1.Max := 100;
end else
TForm1(Sender).ProgressBar1.Position := GetPercent(TForm1(Sender).FBytesToCopy, Value);
Result := S_OK;
end;
Arch.SetProgressCallback(Pointer(Form1), ProgressCallback);