我用微软专家的方法:
static DWORD CALLBACK 
MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
   CFile* pFile = (CFile*) dwCookie;   *pcb = pFile->Read(pbBuff, cb);   return 0;
}void CTest0522_3View::OnButton3() 
{
// TODO: Add your control notification handler code here
   CFile cFile(TEXT("C:\\myfile.txt"), CFile::modeRead);
   EDITSTREAM es;   es.dwCookie = (DWORD) &cFile;
   es.pfnCallback = MyStreamInCallback;
   CRichEditCtrl* crctl = (CRichEditCtrl*)this->GetDlgItem(IDC_RICHEDIT1);
   crctl->StreamIn(SF_TEXT, es);
   //其他代码

}
可是为什么RichEdit控件中只会显示myfile.txt的第一行呢?我看了cb,大小的确为文件的大小。为什么  *pcb = pFile->Read(pbBuff, cb);不能把文件全部读入呢?