MORE INFORMATION
When the client is in cached Exchange mode, messages in the OST can be in one of two states:
- The whole message. This includes the header and the body.
- The message with only its header downloaded.
When you request an IMessage interface for a message in an OST and the client is in cached Exchange mode, use the IID_IMessageRaw GUID. If you use the IID_IMessage GUID to request an IMessage interface, and the message has only its header downloaded, a synchronization is forced. The sychronization tries to download the whole message.
If you use the IID_IMessageRaw GUID or the IID_IMessageGUID GUID to request an IMessage interface, the interfaces that are returned are identical in use. The IMessage interface that was requested by using the IID_IMessageRaw GUID will return an e-mail message as it exists in the OST, and synchronization is not forced.
If the
OpenEntry method returns the MAPI_E_INTERFACE_NOT_SUPPORTED error code, the message store does not support accessing the message in raw mode. In this situation, try the
OpenEntry method again by passing the IID_IMessage GUID.
Note Although cached mode is similar to remote mail headers in classic offline mode, the default behavior is different. Remote mail header messages are not downloaded when they are accessed. This GUID will not work with remote mail headers.
The following is the definition of the IID_IMESSAGE_RAW GUID.
#if !defined(INITGUID) || defined(USES_IID_IMessageRaw)
DEFINE_OLEGUID(IID_IMessageRaw, 0x0002038A, 0, 0);
#endif
When you call the
OpenEntry method, pass the IID_IMessageRaw GUID instead of the IID_IMessage GUID.
HRESULT HrOpenRawMessage
(
LPMDB lpMSB,
ULONG cbEntryID,
LPENTRYID lpEntryID,
ULONG ulFlags,
LPMESSAGE* lpMessage
)
{
ULONG ulObjType = NULL;
HRESULT hRes = lpMDB->OpenEntry(
cbEntryID,
lpEntryID,
IID_IMessageRaw,
ulFlags,
&ulObjType,
(LPUNKNOWN*) lpMessage));
return hRes;
}