Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 4.45 KB

nf-objidl-ibindctx-registerobjectbound.md

File metadata and controls

82 lines (62 loc) · 4.45 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:objidl.IBindCtx.RegisterObjectBound
IBindCtx::RegisterObjectBound (objidl.h)
Registers an object with the bind context to ensure that the object remains active until the bind context is released.
IBindCtx interface [COM]
RegisterObjectBound method
IBindCtx.RegisterObjectBound
IBindCtx::RegisterObjectBound
RegisterObjectBound
RegisterObjectBound method [COM]
RegisterObjectBound method [COM]
IBindCtx interface
_com_ibindctx_registerobjectbound
com.ibindctx_registerobjectbound
objidl/IBindCtx::RegisterObjectBound
com\ibindctx_registerobjectbound.htm
com
84d49231-5fdd-4a89-8e76-1f0e56bc553f
12/05/2018
IBindCtx interface [COM],RegisterObjectBound method, IBindCtx.RegisterObjectBound, IBindCtx::RegisterObjectBound, RegisterObjectBound, RegisterObjectBound method [COM], RegisterObjectBound method [COM],IBindCtx interface, _com_ibindctx_registerobjectbound, com.ibindctx_registerobjectbound, objidl/IBindCtx::RegisterObjectBound
objidl.h
Windows
Windows 2000 Professional [desktop apps \| UWP apps]
Windows 2000 Server [desktop apps \| UWP apps]
ObjIdl.idl
Windows
19H1
IBindCtx::RegisterObjectBound
objidl/IBindCtx::RegisterObjectBound
c++
APIRef
kbSyntax
COM
ObjIdl.h
IBindCtx.RegisterObjectBound

IBindCtx::RegisterObjectBound

-description

Registers an object with the bind context to ensure that the object remains active until the bind context is released.

-parameters

-param punk [in]

A pointer to the IUnknown interface on the object that is being registered as bound.

-returns

This method can return the standard return values E_OUTOFMEMORY and S_OK.

-remarks

Those writing a new moniker class (through an implementation of the IMoniker interface) should call this method whenever the implementation activates an object. This happens most often in the course of binding a moniker, but it can also happen while retrieving a moniker's display name, parsing a display name into a moniker, or retrieving the time that an object was last modified.

RegisterObjectBound calls AddRef to create an additional reference to the object. You must, however, still release your own copy of the pointer. Calling this method twice for the same object creates two references to that object. You can release a reference obtained through a call to this method by calling IBindCtx::RevokeObjectBound. All references held by the bind context are released when the bind context itself is released.

Calling 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 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

IBindCtx

IRunningObjectTable::GetObject