如何把CRichEditCtrl中的所有文字保存到doc(或者RTF也行)文件中?

解决方案 »

  1.   

    只见有一个StreamOut函数是可以输出的。@
      

  2.   

    Example// My callback procedure that reads the rich edit control contents
    // from a file.
    static DWORD CALLBACK 
    MyStreamOutCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
    {
       CFile* pFile = (CFile*) dwCookie;   pFile->Write(pbBuff, cb);
       *pcb = cb;   return 0;
    }// The example code.
       // The pointer to my rich edit control.
       extern CRichEditCtrl* pmyRichEditCtrl;
       // The file to store the contents of the rich edit control.
       CFile cFile(TEXT("myfile.rtf"), CFile::modeCreate|CFile::modeWrite);
       EDITSTREAM es;   es.dwCookie = (DWORD) &cFile;
       es.pfnCallback = MyStreamOutCallback; 
       pmyRichEditCtrl->StreamOut(SF_RTF, es);
      

  3.   

    http://www.codeproject.com/richedit/autoricheditctrl.asp
    http://www.codeproject.com/useritems/SimpleWordPad.asp
      

  4.   

    to:  vcmute(横秋) 
    无法解析的外部符号 CRichEditEx pmyRichEditCtrl如何能使pmyRichEditCtrl指向我对话框中的增强CRichEditCtrl类CRichEditEx控件m_CtrlRichMsg