Share via


IMimeMessageTree::SaveOffsetTable method

Saves the offset table of a message for quicker loading.

Syntax

HRESULT SaveOffsetTable(
  [in] IStream *pStream,
  [in] DWORD   dwFlags
);

Parameters

pStream [in]

Type: IStream*

Specifies a pointer to an IStream to save the offset table to.

dwFlags [in]

Type: DWORD

Specifies how an IMimeMessageTree object should be committed.

Value Meaning
COMMIT_ONLYIFDIRTY
0x00000001
Indicates that if the message object is dirty, the message should internally commit all changes so that the method being called reflects the committed state of the message.
COMMIT_REUSESTORAGE
0x00000002
Indicates that if the message object needs to commit itself, it should reuse its current storage object. For example, if a message object is loaded from a client provided IStream, the message object saves itself back into that original IStream.
COMMIT_SMIMETRANSFERENCODE
0x00000004
Indicates secure messaging.

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
S_OK
Indicates success.
E_FAIL
Indicates that an unknown error has occurred.
E_INVALIDARG
Indicates that pStream is NULL.
E_OUTOFMEMORY
Indicates that an attempt to allocate memory failed.
IStream::Write
This method may return a failure result from the ISequentialStream::Write method.
MIME_E_UNKNOWN_BODYTREE_VERSION
Indicates that the version of the offset table is invalid or not supported.

Remarks

Offset tables are used to improve performance when loading a message. The offset table contains information about the message, which enables MimeOLE to quickly load the message. Typically, the first time a client loads a message, they should call IMimeMessageTree::SaveOffsetTable. Then, the next time the client loads the message, they should first call IMimeMessageTree::LoadOffsetTable before loading the actual message into the message object.

Using offset tables is optional.

Examples

The following code demonstrates how to save the offset table.

IMimeMessageTree::Load(*pMessageSource);
IMimeMessageTree::SaveOffsetTable(*pOffsetTable);

The following code demonstrates how to load a message with an offset table.

IMimeMessageTree::LoadOffsetTable(*pOffsetTable);
IMimeMessageTree::Load(*pMessageSource);

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Mimeole.h
IDL
Mimeole.idl
DLL
Inetcomm.dll (version 6.0 or later)

See also

IMimeMessageTree

Reference

LoadOffsetTable

Other Resources

IPersistStreamInit::Load