IRunningObjectTable  B6W00U

The IRunningObjectTable interface manages access to the Running Object Table (ROT), a globally accessible look-up table on each workstation. A workstation s ROT keeps track of those objects that can be identified by a moniker and that are currently running on the workstation. When a client tries to bind a moniker to an object, the moniker checks the ROT to see if the object is already running; this allows the moniker to bind to the current instance instead of loading a new one.

The ROT contains entries of the form:

(pmkObjectName, pUnkObject)

 

The pmkObjectName element is a pointer to the moniker that identifies the running object. The pUnkObject element is a pointer to the running object itself. During the binding process, monikers consult the pmkObjectName entries in the Running Object Table to see if an object is already running.

Objects that can be named by monikers must be registered with the ROT when they are loaded and their registration must be revoked when they are no longer running.

When to Implement

You do not need to implement this interface. The system provides an implementation of the Running Object Table that is suitable for all situations.

When to Use

You typically use the ROT if you re a moniker provider (that is, you hand out monikers identifying your objects to make them accessible to others) or if you re writing your own moniker class (that is, implementing the IMoniker18XK102 interface).

If you are a moniker provider, you register your objects with the ROT when they begin running and revoke their registrations when they are no longer running. This enables the monikers that you hand out to be bound to running objects. You should also use the ROT to record the object s last modification time. You can get an IRunningObjectTable interface pointer to the local ROT by calling the GetRunningObjectTable4LY6_QB function.

The most common type of moniker provider is a compound-document link source. This includes server applications that support linking to their documents (or portions of a document) and container applications that support linking to embeddings within their documents. Server applications that do not support linking can also use the ROT to cooperate with container applications that support linking to embeddings.

If you are writing your own moniker class, you use the ROT to determine whether a object is running and to retrieve the object s last modification time. You can get an IRunningObjectTable interface pointer to the local ROT by calling the IBindCtx::GetRunningObjectTable5J01OF method on the bind context for the current binding operation. Moniker implementations should always use the bind context to acquire a pointer to the ROT; this allows future implementations of IBindCtx to modify binding behavior. Note that you must also implement the IROTData45ZVM_ interface on your moniker class in order to allow your monikers to be registered with the ROT.

Methods in VTable Order

IUnknown1NEM0LU Methods

Description

QueryInterface2Y54585

Returns pointers to supported interfaces.

AddRef1SHW0SS

Increments reference count.

ReleaseDUW01A

Decrements reference count.

 

IRunningObjectTable Methods

Description

RegisterW.39BO

Registers an object with the ROT.

Revoke1MJ36P

Revokes an object s registration with the ROT.

IsRunning24E7MQP

Checks whether an object is running.

GetObject1K3D_R

Returns a pointer to an object given its moniker.

NoteChangeTime1Y6VCP1

Notifies the ROT that an object has changed.

GetTimeOfLastChange5OIBU_

Returns the time an object was last changed.

EnumRunning2JF.J8E

Returns an enumerator for the ROT.

 

See Also

IBindCtx::GetRunningObjectTable5J01OF, IROTData45ZVM_, GetRunningObjectTable4LY6_QB