如果你的m_RichEdit是CRichEditCtrl的话,就有 CRichEditCtrl::StremIn(int nFormat, EDITSTREAM& es)的方法你仔细看一看有关EDITSTREAM的说明,需要用CallBack函数去处理数据流。

解决方案 »

  1.   

    这是MSDN中关于CRichEditCtrl::StreamIn(...)的例子
    Example// My callback procedure that writes the rich edit control contents
    // to a file.
    static DWORD CALLBACK 
    MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
    {
       CFile* pFile = (CFile*) dwCookie;   *pcb = pFile->Read(pbBuff, cb);   return 0;
    }// The example code.
       // The pointer to my rich edit control.
       extern CRichEditCtrl* pmyRichEditCtrl;
       // The file from which to load the contents of the rich edit control.
       CFile cFile(TEXT("myfile.rtf"), CFile::modeRead);
       EDITSTREAM es;   es.dwCookie = (DWORD) &cFile;
       es.pfnCallback = MyStreamInCallback; 
       pmyRichEditCtrl->StreamIn(SF_RTF, es);