CFile文件读取
void ChuffmanDlg::OnBnClickedButton1() { // TODO: 在此添加控件通知处理程序代码 CFileDialog fd(TRUE); CString filename; CFile fileread; if (fd.DoModal()==IDOK) { filename=fd.GetPathName(); } fileread.Open(filename,CFile::modeRead); //不要用modeText,用了就错 int filesize=fileread.GetLength(); fileread.Read(huffword.GetBuffer(filesize),filesize); huffword.ReleaseBuffer(); m_edit1=huffword; fileread.Close(); UpdateData(FALSE); }