hi
i have a CRichEditCtrl in my app and it can't open UNICODE files properly (opens ANSI files ok). what do i have to do ?
here's part of my code:
CRichEditCtrl * richedit = (CRichEditCtrl *)GetDlgItem(IDC_RICHEDIT1);
CFile file(filename, CFile::modeRead);
EDITSTREAM es;
es.dwCookie = (DWORD) &file;
es.pfnCallback = MyStreamInCallback;
richedit->StreamIn(SF_TEXT, es);
richedit->SetReadOnly();
the callback is straight from msdn i think ..
static DWORD CALLBACK
MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}
i have a CRichEditCtrl in my app and it can't open UNICODE files properly (opens ANSI files ok). what do i have to do ?
here's part of my code:
CRichEditCtrl * richedit = (CRichEditCtrl *)GetDlgItem(IDC_RICHEDIT1);
CFile file(filename, CFile::modeRead);
EDITSTREAM es;
es.dwCookie = (DWORD) &file;
es.pfnCallback = MyStreamInCallback;
richedit->StreamIn(SF_TEXT, es);
richedit->SetReadOnly();
the callback is straight from msdn i think ..
static DWORD CALLBACK
MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}