Share via


IMimeMessageTree::LoadOffsetTable method

Loads an offset table into the message object for quicker loading.

Syntax

HRESULT LoadOffsetTable(
  [in] IStream *pStream
);

Parameters

pStream [in]

Type: IStream*

Specifies a pointer to an IStream that contains the offset table. This stream, which MimeOLE reads from, needs to be positioned at the beginning of the offset table data. When the method returns, the position of the stream is at the end of the offset table. If this method fails, the position of this stream is undefined.

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.
MIME_E_CORRUPT_CACHE_TREE
Indicates that the offset table is invalid or corrupt.
E_OUTOFMEMORY
Indicates that an attempt to allocate memory failed.
IStream::Read
This method may return a failure result from the ISequentialStream::Read 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 that 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.

For robustness, if a call to IMimeMessageTree::LoadOffsetTable fails, the client should ignore the failure and continue to load the message. If calls to LoadOffsetTable are consistently failing, there is most likely a problem that needs further investigation.

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

SaveOffsetTable

Other Resources

IPersistStreamInit::Load