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 checks whether object is running.

Syntax

HRESULT IsRunning( 
  IBindCtx* 
pbc, 
  IMoniker* 
pmkToLeft, 
  IMoniker* 
pmkNewlyRunning
);

Parameters

pbc

[in] Pointer to the IBindCtxinterface on the bind context to be used in this binding operation.

The bind context caches objects bound during the binding process, contains parameters that apply to all operations using the bind context, and provides the means by which the moniker implementation should retrieve information about its environment.

For more information, see IBindCtx.

pmkToLeft

[in] Pointer to the IMonikerinterface on the moniker to the left of this moniker if this moniker is part of a composite.

This parameter is primarily used by moniker Implementers to enable cooperation between the various components of a composite moniker; moniker clients can usually pass NULL.

pmkNewlyRunning

[in] Pointer to the IMonikerinterface on the moniker most recently added to the Running Object Table (ROT).

This can be NULL.

If non-NULL, the implementation can return the results of calling the IMoniker::IsEqualmethod on the pmkNewlyRunningparameter, passing the current moniker.

This parameter is intended to enable IMoniker::IsRunningimplementations that are more efficient than just searching the ROT, but the implementation can choose to ignore pmkNewlyRunningwithout causing any harm.

Return Value

The method supports the standard return value E_UNEXPECTED.

The following table shows the additional return values for this method.

Value Description

S_OK

The moniker is running.

S_FALSE

The moniker is not running.

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Callers

If speed is important when you are requesting services from the object identified by the moniker, you may want those services onlyif the object is already running (because loading an object into the running state may be time-consuming).

In such a situation, you would call IMoniker::IsRunningto determine if the object is running.

For the monikers stored within linked objects, IMoniker::IsRunningis primarily called by the default handler's implementation of IOleLink::BindIfRunning.

Notes to Implementers

To get a pointer to the Running Object Table (ROT), your implementation should call the IBindCtx::GetRunningObjectTablemethod on the pbcparameter.

Your implementation can then call the IRunningObjectTable::IsRunningmethod to determine whether the object identified by the moniker is running.

Note that the object identified by the moniker must have registered itself with the ROT when it first began running.

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