VC 中怎么保存或打开富文本内容?

来源:百度知道 编辑:UC知道 时间:2024/06/07 10:43:33
直接用系统提供的是不行的.我目的就是实现能把带有颜色,字体等信息的文字保存成RTF或DOC型的文件,模仿WORD.

CRichEditCtrl::Stream

CRichEditCtrl::StreamIn
Writes out the contents of this CRichEditCtrl object to the specified output stream.

long StreamOut(
int nFormat,
EDITSTREAM& es
);

Parameters

nFormat
Flags specifying the output data formats. See the Remarks section for more information.
es
EDITSTREAM structure specifying the output stream. See the Remarks section for more information.
Return Value
Number of characters written to the output stream.
Remarks
The value of nFormat must be one of the following:
SF_TEXT Indicates writing text only.
SF_RTF Indicates writing text and formatting.
SF_RTFNOOBJS Indicates writing text and formatting, replacing OLE items with spaces.
SF_TEXTIZED Indicates writing text and formatting, with textual representations of OLE items.
Any of these values can be combined with SFF_SELECTION. If SFF_SELECTION is spe