IBindCtx::RegisterObjectBound
Calls IUnknown::AddRef
HRESULT RegisterObjectBound(
IUnknown *punk |
//Pointer to the object being registered |
); |
|
Parameter
punk
[in] Pointer
to the IUnknown interface on the object that is being registered as
bound.
Return Values
This method
supports the standard return value E_OUTOFMEMORY, as well as the following:
S_OK
The object
was successfully registered.
Remarks
Notes to Callers
Those writing
a new moniker class (through an implementation of the IMoniker
IBindCtx::RegisterObjectBound calls IUnknown::AddRef
Calling IBindCtx::RegisterObjectBound
to register an object with a bind context keeps the object active until the
bind context is released. Reusing a bind context in a subsequent binding
operation (either for another piece of the same composite moniker, or for a
different moniker) can make the subsequent binding operation more efficient
because it doesn t have to reload that object. This, however, improves
performance only if the subsequent binding operation requires some of the same
objects as the original one, so you need to balance the possible performance
improvement of reusing a bind context against the costs of keeping objects
activated unnecessarily.
IBindCtx does not provide a method to retrieve a pointer to an
object registered using IBindCtx::RegisterObjectBound. Assuming the
object has registered itself with the Running Object Table, moniker
implementations can call IRunningObjectTable::GetObject to retrieve a
pointer to the object.
See Also