Класс CRichEditCtrl
void CModelessDemoDlg::ReadRTFDocument(CString const& strFilename)
{
CFile * file = new CFile(strFilename,CFile::modeRead|CFile::typeBinary);
EDITSTREAM es;
es.dwCookie = (DWORD) &file;
es.pfnCallback = MyStreamInCallback;
m_edtRTFDocument.StreamIn(SF_RTF,es);
}
static DWORD CALLBACK MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}
m_edtRTFDocument - объект класса CRichEditCtrl