WrapCompressedRTFStream

The WrapCompressedRTFStream function creates a text stream in uncompressed Rich Text Format (RTF) from the compressed format used in the PR_RTF_COMPRESSED property.

Quick Info

Header file: MAPIUTIL.H
Implemented by: MAPI
Called by: Client applications

HRESULT WrapCompressedRTFStream(
  LPSTREAM lpCompressedRTFStream,         
  ULONG ulflags,                          
  LPSTREAM FAR * lpUncompressedRTFStream  
);
 

Parameters

lpCompressedRTFStream
[in] Pointer to a stream opened on the PR_RTF_COMPRESSED property of a message.
ulFlags
[in] Bitmask of option flags for the function. The following flags can be set:
MAPI_MODIFY
Whether the client intends to read or write the wrapped stream interface that is returned.
STORE_UNCOMPRESSED_RTF
Uncompressed RTF should be written to the stream pointed to by lpCompressedRTFStream
lpUncompressedRTFStream
[out] Pointer to the location where WrapCompressedRTFStream returns a stream for the uncompressed RTF.

Return Values

S_OK
The call succeeded and has returned the expected value or values.

Remarks

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.

See Also

RTF Synchronization Functions, RTFSync