Contents Previous Page Next Page
CreateAsyncBindCtx

Creates an asynchronous bind context for use with asynchronous monikers.

HRESULT CreateAsyncBindCtx(

    DWORD
  dwReserved,                        //Reserved for future use; must be zero           
                                                                                                
    IBindStatusCallback *pbsc,                //Pointer to callback interface                   
                                                                                                
    DWORD  grfBSCOption,                      //BSCO_OPTION flags                               
                                                                                                
    IEnumFORMATETC*penumfmtetc,               //Pointer to enumerator object for formats        
                                                                                                
    IBindCtx **ppbc                           //Indirect pointer to new bind context            
                                                                                                
   );                                                                                           
                                                                                                

Parameters

dwReserved

[in] Reserved for future use; must be zero.

pbsc

[in] Pointer to the IBindStatusCallback interface used for receiving data availability and progress notification.

grfBSCOption

[in] Flags from the BSCO_OPTION enumeration specifying which callback notifications the client wants to receive.

penumfmtetc

[in] Pointer to the IEnumFORMATETC interface that can be used to enumerate formats for format negotiation during binding. This parameter can be NULL, in which case the caller is not interested in format negotiation during binding, and the default format of the object will be bound to.

ppbc

[out] Indirect pointer to the IBindCtx interface for the new bind-context.

Return Values

S_OK

The operation completed successfully.

E_OUTOFMEMORY

The method ran out of memory and did not complete.

E_INVALIDARG

One or more parameters are invalid.

Remarks

This function automatically registers the IBindStatusCallback and the IEnumFORMATETC interfaces with the bind context. The grfBSCOption parameter allows the client to specify flags indicating which callback notifications the client is capable of receiving. If the client does not wish to receive certain notification, it can choose to implement those callback methods as empty function stubs (returning E_NOTIMPL), and they should not be called.

The RegisterBindStatusCallback function can also be used to register callback interfaces in the bind context.

See Also

IBindStatusCallback, BSCO_OPTION, RegisterBindStatusCallback