IBindCtx::RegisterObjectParam

HRESULT IBindCtx::RegisterObjectParam(lpszKey, punk)

Register the given object pointer under the name lpszKey in the internally-maintained table of object pointers. The intent of this table is that it be used as an extensible means by which contextual information can be passed to the binding process. String keys are compared case-sensitive.

Like IBindCtx::RegisterObjectBound, this function creates an additional reference to the passed-in object using AddRef. The effect of calling this function a second time with the same lpszKey is to replace in the table the object passed-in the first time.

By convention, moniker implementers may freely use object parameters whose names begin with the string representation of the class id of the moniker implementation in question.

This facility is also used as means by which various errors can convey information back to the caller. Associated with certain error values are the following object parameters:

Error

Parameters

MK_E_EXCEEDEDDEADLINE

Parameters named ExceededDeadline, ExceededDeadline1, ExceededDeadline2, and so forth, if they exist, are monikers who appearance as running would make it reasonable for the caller to attempt the binding operation again.

E_CLASSNOTFOUND

The parameter named ClassNotFound, if present, is a moniker to the storage of the object whose class was not able to be loaded in the process of a moniker operation.


New moniker authors can freely use parameter names that begin with the string form of the CLSID of their moniker; see StringFromCLSID().

The arguments to this function are as follows:

Argument

Type

Description

lpszKey

LPSTR

The name under which the object is being registered.

punk

IUnknown*

The object being registered.

return value

HRESULT

S_OK, E_OUTOFMEMORY