cheng_young(古道西风瘦马) :你的例子在编译的时候出现一个错误error C2440: '=' : cannot convert from 'unsigned long (__stdcall CJournalDlg::*)(unsigned long,unsigned char *,long,long *)' to 'unsigned long (__stdcall *)(unsigned long,unsigned char *,long,long *)' There is no context in which this conversion is possible 是针对“es.pfnCallback = MyStreamInCallback; ”这句话的错误,能帮忙看一下吗?
DWORD CALLBACK MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}OnInitDialog:
CFile file("ReadMe.txt", CFile::modeRead);
EDITSTREAM es;
es.dwCookie = (DWORD) &file;
es.pfnCallback = MyStreamInCallback;
m_edit.StreamIn(SF_TEXT, es);
file.Close();
file.open
file.Read;
setwindowtext
There is no context in which this conversion is possible
是针对“es.pfnCallback = MyStreamInCallback; ”这句话的错误,能帮忙看一下吗?
{
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}
{
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}
直接写在CPP文件里就行了, 放在OnInitDialog之前