MFC读取txt文件后面多出了一些乱码
void CReadFileDlg::OnEnChangeMfceditbrowse1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialogEx::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
CString strText,str;
GetDlgItemText(IDC_MFCEDITBROWSE1, strText);
CFile f;
f.Open(strText, CFile::modeReadWrite);
f.Read(str.GetBuffer(f.GetLength()), f.GetLength());
f.Close();
MessageBox(str);
}
比如读取的文件里面只写了“0”读取显示的就是0**乱码
我刚学MFC望多多指点