Platform SDK: Exchange Server

IExchExtCallback::GetObject

Returns interfaces for a particular object and the object’s containing store. The interfaces returned depend on the context of the caller. For a list of possible interfaces returned, see the “Remarks” section.

Quick Info

See IExchExtCallback : IUnknown.

HRESULT GetObject(
  LPMDB FAR * lppmdb,     
  LPMAPIPROP FAR * lppmp  
);
 

Parameters

lppmdb
[out] Pointer to a pointer to the store object containing the lppmp parameter.
lppmp
[out] Pointer to a pointer to a MAPI object.

Return Values

S_OK
Either the lppmdb or lppmp parameter returned non-null values.
S_FALSE
Both the lppmdb and lppmp parameters returned NULL values.
E_INVALIDARG
Both the lppmdb and lppmp parameters are NULL.

Remarks

The IExchExtCallback::GetObject method is used to return an interface and message store for a particular object. The interface returned depends on the context or the caller. When called by the IExchExtPropertySheets::GetPages method, the object is the object for which information should be displayed, and the store is the store containing that object.

The interfaces must be released before the call which was given the lpeecb parameter returns. The following list describes the interfaces that are returned when GetObject is called from various contexts.

EECONTEXT_SESSION, EECONTEXT_TASK
Both interfaces returned are NULL.
EECONTEXT_VIEWER
The interfaces returned by GetObject are NULL when called from the IExchExt::Install or IExchExtCommands::InstallCommands methods because the Viewer is not necessarily permanently associated with the same store or object.

When called from the IExchExtCommands::InitMenu or IExchExtCommands::DoCommand methods, the object is the open folder being displayed and the store is the store that contains that folder. When the root of a store is displayed, the object is the IPM_SUBTREE folder. Both pointers are NULL when the list of stores is displayed in the content pane.

EECONTEXT_REMOTEVIEWER
Both interfaces are NULL.
EECONTEXT_SEARCHVIEWER
The object is the search folder being displayed, and the store is the store which contains that search folder.
EECONTEXT_ADDRBOOK
The interfaces are generally NULL when called from Install or InstallCommands because the address book is not always necessarily associated with the same container.

When called from InitMenu and DoCommand, the object is the ABContainer being displayed and the store is NULL. GetObject is called in the following contexts:

EECONTEXT_SENDNOTEMESSAGE

EECONTEXT_READNOTEMESSAGE

EECONTEXT_SENDPOSTMESSAGE

EECONTEXT_READPOSTMESSAGE

EECONTEXT_READREPORTMESSAGE

EECONTEXT_SENDRESENDMESSAGE

The object is the message being displayed and the store is the store which contains that message.

The object interface returned in the lppmp parameter supports the IMAPIProp : IUnknown interface as well as the additional interface methods specific to its type.

Object Interface type
Folder IMAPIFolder
Message IMessage
Store IMsgStore
Address Book IABContainer

See Also

IExchExt::Install, IExchExtAdvancedCriteria::InstallAdvancedCriteria