我的代码:
void CMy1View::OnErjinzhi() 
{
// TODO: Add your command handler code here
//UpdateData(true);
CFileDialog dlg(TRUE,NULL,NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT, "All Files (*.*)|*.*|Text files(*.txt)|*.txt|Word documents(*.doc)|*.doc||",AfxGetMainWnd());
    CString str;
    if(dlg.DoModal()==IDOK)
    {
         str= dlg.GetPathName();//获取文件名,你可以用这个参数来对文件进行操作,比如fopen()
        MessageBox(str);//这里举了个例子,用MessageBox来弹出你所选中的文件名。
    }
    CStdioFile f1;    //CFile file;
    CString FileName=str;
     f1.Open(FileName,CFile::modeRead | CFile::typeBinary);
     f1.Close();
    AfxGetApp()->OpenDocumentFile(str);   //  UpdateData(false);//在文本框显示
     MessageBox("读出成功!");

为何还是以文本方式输出呢?
请各位大侠指教~