Partilhar via


IBindHost::MonikerBindToObject method

Binds a moniker to an object.

Syntax

HRESULT MonikerBindToObject(
  [in]  IMoniker            *pMk,
  [in]  IBindCtx            *pBC,
  [in]  IBindStatusCallback *pBSC,
  [in]  REFIID              riid,
  [out] void                **ppvObj
);

Parameters

  • pMk [in]
    The address of the IMoniker interface of the moniker.

  • pBC [in]
    The address of the IBindCtx interface of the bind context.

  • pBSC [in]
    The address of the IBindStatusCallback interface.

  • riid [in]
    An identifier of the interface that the client application uses to communicate with the object.

  • ppvObj [out]
    The address of the interface that is identified by riid. If ppvObj is not NULL, the application must call the AddRef method on the interface, and then call Release when it is finished using the interface.

Return value

Returns one of the following values.

Return code Description
S_OK

The bind operation completed synchronously and successfully. The result of the bind operation is available in ppvObj.

MK_S_ASYNCHRONOUS

The bind operation completes asynchronously. The behavior matches that of IMoniker::BindToObject.

E_OUTOFMEMORY

There is insufficient memory to create the moniker.

E_UNEXPECTED

An unknown error occurred.

 

Remarks

This method behaves the same as IMoniker::BindToObject, except that it provides the control container (implementor of IBindHost) enough authority over the bind operation so that the control container can take charge of setting bind options and priority, while it delegates all results and callbacks for the bind operation back to the control.

A host or control that implements IBindHost should implement IHttpNegotiate. It should also implement IServiceProvider to provide a pointer to its IHttpNegotiate interface when IHttpNegotiate is requested through QueryService.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Product

Internet Explorer 4.0

DLL

Urlmon.dll

See also

IBindHost