Die stehen doch oben. -.-'
Hier nochmal für die die keine lust haben nach oben zu scrollen.
Delphi-Quellcode:
type
cDownloadStatusCallback = class(TObject,IUnknown,IBindStatusCallback)
private
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: 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;
Source:
function cDownloadStatusCallback._AddRef: Integer;
begin
Result := 0;
end;
function cDownloadStatusCallback._Release: Integer;
begin
Result := 0;
end;
function cDownloadStatusCallback.QueryInterface(const IID: TGUID; out Obj): HResult;
begin
if(GetInterface(IID,Obj)) then
begin
Result := 0
end
else
begin
Result := E_NOINTERFACE;
end;
end;
function cDownloadStatusCallback.OnStartBinding(dwReserved: DWORD; pib: IBinding): HResult;
begin
Result := S_OK;
end;
//
function cDownloadStatusCallback.GetPriority(out nPriority): HResult;
begin
Result := S_OK;
end;
function cDownloadStatusCallback.OnLowResource(reserved: DWORD): HResult;
begin
Result := S_OK;
end;
function cDownloadStatusCallback.OnStopBinding(hresult: HResult; szError: LPCWSTR): HResult; stdcall;
begin
Result := S_OK;
end;
function cDownloadStatusCallback.GetBindInfo(out grfBINDF: DWORD; var bindinfo: TBindInfo): HResult; stdcall;
begin
Result := S_OK;
end;
//
function cDownloadStatusCallback.OnDataAvailable(grfBSCF: DWORD; dwSize: DWORD; formatetc: PFormatEtc; stgmed: PStgMedium): HResult;
begin
Result := S_OK;
end;
//
function cDownloadStatusCallback.OnObjectAvailable(const iid: TGUID; punk: IUnknown): HResult; stdcall;
begin
Result := S_OK;
end;
function cDownloadStatusCallback.OnProgress(ulProgress, ulProgressMax, ulStatusCode: ULONG; szStatusText: LPCWSTR): HResult;
begin
case ulStatusCode of
BINDSTATUS_BEGINDOWNLOADDATA:
begin
MainFrm.ProgressBalken.Width := 0;
MessageDlg('Der Download wurde gestartet.', MtInformation, [mbYes], 0);
if (UserCancel) then
begin
Result := E_ABORT;
exit;
function _Release: Integer; stdcall;
end;
end;
BINDSTATUS_DOWNLOADINGDATA:
begin
MainFrm.ProgressBalken.Width := MulDiv(ulProgress,100, 240 );
MessageDlg('Datei wird runtergeladen.', MtInformation, [mbYes], 0);
if (UserCancel) then
begin
Result := E_ABORT; exit;
end;
end;
BINDSTATUS_ENDDOWNLOADDATA:
begin
MessageDlg('Download wurde beendet.', MtInformation, [mbYes], 0);
end;
end;
Application.ProcessMessages;
Result := S_OK;
end;
Zitat:
Deklaration von "GetPriority" unterscheidet sich von der Deklaration in interface 'IBindStatusCallBack'
Deklaration von "OnDataAvaiable" unterscheidet sich von der Deklaration in interface 'IBindStatusCallBack'
Deklaration von "OnObjectAvaiable" unterscheidet sich von der Deklaration in interface 'IBindStatusCallBack'