Contents Previous Page Next Page
IBindStatusCallback::OnStartBinding

Notifies the client about the callback methods it is registered for receiving. This notification is a response to the flags the client requested in RegisterBindStatusCallback.

HRESULT OnStartBinding(

    DWORD  
grfBSCOption,          //BSCO_OPTION flags                                                      
                                                                                                           
    IBinding *pbinding            //Pointer to the IBinding interface for the current bind operation       
                                                                                                           
   );                                                                                                      
                                                                                                           

Parameters

grfBSCOption

[in] Flags from the BSCO_OPTION enumeration that specify which callback notifications the client is registered for receiving.

pbinding

[in] Pointer to the IBinding interface of the current bind operation. May not be NULL. The client should call AddRef on this pointer to keep a reference to the binding object.

Return Values

S_OK

The operation was successful.

E_INVALIDARG

The pbinding parameter is invalid.

Remarks

Asynchronous monikers typically call this method while initiating the bind operation in its implementation of IMoniker::BindToStorage or IMoniker::BindToObject.

In the call to this method, the moniker also provides the client with a pointer to the IBinding interface for the binding object associated with the current bind operation. The client can use the IBinding interface to control the progress of the bind operation.

To keep a reference to the binding object, the client must store the pointer to the IBinding interface and call AddRef on it. When the client no longer needs the reference, it must call Release on it. Note that calling Release does not cancel the bind operation, it simply frees the reference to the IBinding interface sent in the callback.

Notes to Implementers

A client can return E_UNIMPL or S_OK if it is not interested in receiving this notification.

See Also

BSCO_OPTION, IBinding, IBindStatusCallback::OnStopBinding, RegisterBindStatusCallback