# IBindCtx::GetObjectParam

Retrieves the pointer associated with the specified key in the bind context’s string-keyed table of pointers.

HRESULT GetObjectParam(

LPOLESTR pszKey, | //Pointer to the key to be used
IUnknown **ppunk | //Indirect pointer to the object associated with the key
); |

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] When successful, indirect pointer to the IUnknown interface on the object associated with pszKey. In this case, the implementation calls IUnknown::AddRef on the parameter. It is the caller’s responsibility to call IUnknown::Release. If an error occurs, ppunk is set to NULL.

Return Values

This method supports the standard return value E_FAIL, as well as the following:

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::RegisterObjectParam method.

#### 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::RegisterObjectParam for more information.

Moniker implementations can call this method to deal with situations where a caller initates 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 StringFromCLSID function).

See Also

IBindCtx::RegisterObjectParam, IBindCtx::EnumObjectParam