Why CRichEditCtrl cannot show images in a RTF file?
Posted on 2004-04-30
I create a dialogbox and add a CRichEditCtrl on it. Then I use the following codes to read a RTF file into the CRichEditCtrl, as follows(this is the sample from MSDN):
// 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);
// 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);
es.dwCookie = (DWORD) &cFile;
es.pfnCallback = MyStreamInCallback;
However, when the codes are executed, only the texts in RTF can be displayed in CRichEditCtrl, the images cannot be displayed. Why?