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 calls the IUnknown::AddRefmethod on the specified object to ensure that the object remains active until the bind context is released. The method stores a pointer to the object in the bind context's internal list of pointers.

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

Calling this method in COM returns a value of E_NOTIMPL.

Syntax

HRESULT RegisterObjectBound(
  IUnknown* 
punk
);

Parameters

punk

[in] Pointer to the IUnknowninterface on the object that is being registered as bound.

Return Value

The following table shows the return values for this method.

Value Description

E_OUTOFMEMORY

A standard return value.

S_OK

The object was successfully registered.

Remarks

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 the IMonikerinterface) 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.

IBindCtx::RegisterObjectBoundcalls IUnknown::AddRefto 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 the IBindCtx::RevokeObjectBoundmethod.

All references held by the bind context are released when the bind context itself is released.

Calling IBindCtx::RegisterObjectBoundto 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 does not 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.

The IBindCtxinterface 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 the IRunningObjectTable::GetObjectmethod to retrieve a pointer to the object.

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

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.