The WrapCompressedRTFStream function creates a text stream in uncompressed Rich Text Format (RTF) from the compressed format used in the PR_RTF_COMPRESSED property.
Header file: | MAPIUTIL.H |
Implemented by: | MAPI |
Called by: | Client applications |
HRESULT WrapCompressedRTFStream(
LPSTREAM lpCompressedRTFStream,
ULONG ulflags,
LPSTREAM FAR * lpUncompressedRTFStream
);
If the MAPI_MODIFY flag is passed in the ulFlags parameter, the lpCompressedRTFStream parameter must already be open for reading and writing. New, uncompressed RTF text should be written into the stream interface returned in lpUncompressedRTFStream. Because it is not possible to append the existing stream, the entire message text must be written.
If zero is passed in the ulFlags parameter, then lpCompressedRTFStream may be opened read-only. Only the entire message text can be read out of the stream interface returned in lpUncompressedRTFStream; it is not possible to search into the middle of the stream and begin reading.
WrapCompressedRTFStream assumes that the compressed stream's pointer is set to the beginning of the stream. Certain OLE IStream methods are not supported by the returned uncompressed stream. These include IStream::Clone, IStream::LockRegion, IStream::Revert, IStream::Seek, IStream::SetSize, IStream::Stat, and IStream::UnlockRegion. In order to copy to the entire stream, a read/write loop is needed.
Because the client writes new RTF in uncompressed format, it should use WrapCompressedRTFStream, rather than directly writing to the stream. RTF-aware clients should search for the STORE_UNCOMPRESSED_RTF flag in the PR_STORE_SUPPORT_MASK property and pass it to WrapCompressed RTFStream if it is set.
RTF Synchronization Functions, RTFSync