Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method retrieves the pointer associated with the specified key in the bind context's string-keyed table of pointers.

The IBindCtx::GetObjectParammethod is supported in DCOM, but it is not supported in COM.

Calling this method in COM returns a value of E_NOTIMPL.

Syntax

HRESULT GetObjectParam(
  LPOLESTR 
pszKey,
  IUnknown** 
ppunk
);

Parameters

pszKey

[in] Pointer to a zero-terminated wide character string (two bytes per character) containing the key to search for. Key string comparison is case-sensitive.

ppunk

[out] Address of the IUnknown*pointer variable that receives the interface pointer to the object associated with pszKey.

When successful, the implementation calls the IUnknown::AddRefmethod on *ppunk.

It is the caller's responsibility to call the IUnknown::Releasemethod.

If an error occurs, the implementation sets *ppunkto NULL.

Return Value

The following table shows the return values for this method.

Value Description

E_FAIL

A standard return value.

S_OK

The pointer associated with the specified key was successfully returned.

Remarks

A bind context maintains a table of interface pointers, each associated with a string key. This enables communication between a moniker implementation and the caller that initiated the binding operation.

One party can store an interface pointer under a string known to both parties so that the other party can later retrieve it from the bind context.

The pointer this method retrieves must have previously been inserted into the table using the IBindCtx::RegisterObjectParammethod.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Callers

Those writing a new moniker class (through an implementation of IMoniker) and some moniker clients (objects using a moniker to bind to an object) can call IBindCtx::GetObjectParam.

Objects using monikers to locate other objects can call this method when a binding operation fails to get specific information about the error that occurred.

Depending on the error, it may be possible to correct the situation and retry the binding operation. See IBindCtx::RegisterObjectParamfor more information.

Moniker implementations can call this method to deal with situations where a caller initiates a binding operation and requests specific information.

By convention, the implementer should use key names that begin with the string form of the CLSID of a moniker class. See the StringFromCLSIDfunction.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also