This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Creates a text stream in uncompressed Rich Text Format (RTF) from the compressed format used in the PR_RTF_COMPRESSED (PidTagRtfCompressed) property.
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 starting the middle of the stream.
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, instead of directly writing to the stream. RTF-aware clients should search for the STORE_UNCOMPRESSED_RTF flag in the PR_STORE_SUPPORT_MASK (PidTagStoreSupportMask) property and pass it to WrapCompressed RTFStream if it is set.