|
|
|
IBindStatusCallback Interface |
|
IID_IBindStatusCallback |
{79EAC9C1-BAF9-11CE-8C82-00AA004BA90B} |
|
This interface accepts information on an asynchronous bind operation.
A client requesting an asynchronous bind operation must provide a notification object exposing the IBindStatusCallback interface. The asynchronous moniker provides information on the bind operation to the client by calling notification methods on the client's IBindStatusCallback interface. This interface also allows the client to pass additional bind information to the moniker by calling the IBindStatusCallback::GetBindInfo and IBindStatusCallback::GetPriority methods after receiving a call from IMoniker::BindToObject or IMoniker::BindToStorage.
Only the last IBindStatusCallback interface that was registered will be called.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IBindStatusCallback Methods |
Description |
|
OnStartBinding |
Notifies the client about the callback methods it is registered to receive. This notification is a response to the flags the client requested in the RegisterBindStatusCallback function. |
|
GetPriority |
Obtains the priority for the bind operation when called by an asynchronous moniker. |
|
OnLowResource |
Not currently implemented. |
|
OnProgress |
Indicates the progress of the bind operation. |
|
OnStopBinding |
Indicates the end of the bind operation. |
|
GetBindInfo |
Provides information about how the bind operation should be handled when called by an asynchronous moniker. |
|
OnDataAvailable |
Provides data to the client as it becomes available during asynchronous bind operations. |
|
OnObjectAvailable |
Passes the requested object interface pointer to the client. |
|
IBindStatusCallback interface implementation |
$IID_IBindStatusCallback = GUID$("{79EAC9C1-BAF9-11CE-8C82-00AA004BA90B}")
' ****************************************************************************************
' IBindStatusCallback interface virtual table
' ****************************************************************************************
TYPE IBindStatusCallbackVtbl
' IUnknown methods
pQueryInterface AS DWORD ' // QueryInterface method
pAddRef AS DWORD ' // AddRef method
pRelease AS DWORD ' // Release method
' IBindStatusCallback method
pOnStartBinding AS DWORD ' // OnStartBinding method
pGetPriority AS DWORD ' // GetPriority method
pOnLowResource AS DWORD ' // OnLowResource method
pOnProgress AS DWORD ' // OnProgress method
pOnStopBinding AS DWORD ' // OnStopBinding method
pGetBindInfo AS DWORD ' // GetBindInfo method
pOnDataAvailable AS DWORD ' // OnDataAvailable method
pOnObjectAvailable AS DWORD ' // OnObjectAvailable method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IBindStatusCallback Virtual Table
' Returns a cookie that is a pointer to a IBindStatusCallbackVtbl structure.
' ****************************************************************************************
FUNCTION IBindStatusCallback_BuildVtbl () AS DWORD
LOCAL pVtbl AS IBindStatusCallbackVtbl PTR
LOCAL pUnk AS IBindStatusCallbackVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IBindStatusCallback_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IBindStatusCallback_AddRef)
@pVtbl.pRelease = CODEPTR(IBindStatusCallback_Release)
@pVtbl.pOnStartBinding = CODEPTR(IBindStatusCallback_OnStartBinding)
@pVtbl.pGetPriority = CODEPTR(IBindStatusCallback_GetPriority)
@pVtbl.pOnLowResource = CODEPTR(IBindStatusCallback_OnLowResource)
@pVtbl.pOnProgress = CODEPTR(IBindStatusCallback_OnProgress)
@pVtbl.pOnStopBinding = CODEPTR(IBindStatusCallback_OnStopBinding)
@pVtbl.pGetBindInfo = CODEPTR(IBindStatusCallback_GetBindInfo)
@pVtbl.pOnDataAvailable = CODEPTR(IBindStatusCallback_OnDataAvailable)
@pVtbl.pOnObjectAvailable = CODEPTR(IBindStatusCallback_OnObjectAvailable)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IBindStatusCallback_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IBindStatusCallback_QueryInterface (BYVAL pCookie AS IBindStatusCallbackVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IBindStatusCallback THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IBindStatusCallback_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IBindStatusCallback_AddRef (BYVAL pCookie AS IBindStatusCallbackVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IBindStatusCallback_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IBindStatusCallback_Release (BYVAL pCookie AS IBindStatusCallbackVtbl PTR) AS DWORD
DECR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
IF @@pCookie.cRef = 0 THEN
IF ISTRUE @@pCookie.pVtblAddr THEN
HeapFree(GetProcessHeap(), 0, BYVAL @@pCookie.pVtblAddr)
END IF
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Notifies the client about the callback methods it is registered to receive. This
' notification is a response to the flags the client requested in the
' RegisterBindStatusCallback function.
' ****************************************************************************************
FUNCTION IBindStatusCallback_OnStartBinding ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYVAL dwReserved AS DWORD _
, BYVAL pib AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Obtains the priority for the bind operation when called by an asynchronous moniker.
' ****************************************************************************************
FUNCTION IBindStatusCallback_GetPriority ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYREF pnPriority AS LONG _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Not currently implemeneted.
' ****************************************************************************************
FUNCTION IBindStatusCallback_OnLowResource ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYVAL reserved AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Indicates the progress of the bind operation.
' ****************************************************************************************
FUNCTION IBindStatusCallback_OnProgress ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYVAL ulProgress AS DWORD _
, BYVAL ulProgressMax AS DWORD _
, BYVAL ulStatusCode AS DWORD _
, BYVAL szStatusText AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Indicates the end of the bind operation.
' ****************************************************************************************
FUNCTION IBindStatusCallback_OnStopBinding ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYVAL hresult AS LONG _
, BYVAL szError AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Provides information about how the bind operation should be handled when called by an
' asynchronous moniker.
' ****************************************************************************************
FUNCTION IBindStatusCallback_GetBindInfo ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYREF grfBINDF AS DWORD _
, BYREF pbindinfo AS BINDINFO _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Provides data to the client as it becomes available during asynchronous bind operations.
' ****************************************************************************************
FUNCTION IBindStatusCallback_OnDataAvailable ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYVAL grfBSCF AS DWORD _
, BYVAL dwSize AS DWORD _
, BYREF pformatetc AS FORMATETC _
, BYREF pstgmed AS STGMEDIUM _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Passes the requested object interface pointer to the client.
' ****************************************************************************************
FUNCTION IBindStatusCallback_OnObjectAvailable ( _
BYVAL pCookie AS IBindStatusCallbackVtbl PTR _
, BYREF riid AS GUID _
, BYVAL punk AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 19:43:29 +0200