|
IRunningObjectTable::GetObject
Determines whether the object identified by the specified moniker is running,
and if it is, retrieves a pointer to that object. This method looks for the
moniker in the Running Object Table (ROT), and retrieves the pointer registered
there.
HRESULT GetObject(
IMoniker *pmkObjectName,
| //Moniker identifying object desired
| IUnknown **ppunkObject
| //Receives pointer to the object
| );
|
|
Parameters
pmkObjectName
[in] Points to the moniker to search for in the Running Object Table.
ppunkObject
[out] Receives a pointer to the running object. If the object is not running
or if an error occurs, the implementation sets *ppunkObject to NULL. If *ppunkObject is non-NULL, the implementation calls IUnknown::AddRef on the parameter; it is the caller's responsibility to call IUnknown::Release.
Return Values
S_OK
Indicates that pmkObjectName was found in the ROT and a pointer was returned.
S_FALSE
Indicates that there is no entry for pmkObjectName in the ROT, or that the object it identifies is no longer running (in which
case, the entry is revoked).
Comments
This method checks the ROT for the moniker specified by pmkObjectName. If that moniker had previously been registered with a call to IRunningObjectTable::Register, this method returns the pointer that was registered at that time.
Notes to Callers
Generally, you call the IRunningObjectTable::GetObject method only if you are writing your own moniker class (that is, implementing
the IMoniker interface). You typically call this method from your implementation of IMoniker::BindToObject.
However, note that not all implementations of IMoniker::BindToObject need to call this method. If you expect your moniker to have a prefix
(indicated by a non-NULL pmkToLeft parameter to IMoniker::BindToObject), you should not check the ROT. The reason for this is that only complete
monikers are registered with the ROT, and if your moniker has a prefix, your
moniker is part of a composite and thus not complete. Instead, your moniker should
request services from the object identified by the prefix (for example, the
container of the object identified by your moniker).
See Also
IMoniker::BindToObject
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|