{
//TODO: add the command handler code
CFileDialog fileDlg (TRUE);
FileDlg. M_ofn. LpstrFilter=_T (" Text Files (*.txt) \ 0 *. TXT \ 0 all Files (*. *) \ 0 *. * \ \ 0 0 ");
FileDlg. M_ofn. LpstrFileTitle=_T (" open file ");
Char szChar [50].
Memset (szChar, 0, 50);
If (fileDlg DoModal ()==IDOK)
{
CFile file (fileDlg. M_ofn., CFile: : modeRead);
File. Read (szChar, 50);
File. The Close ();
USES_CONVERSION;
MessageBox (A2W (szChar));
}
}
CodePudding user response:
CFile file (fileDlg. M_ofn., CFile: : modeRead);This isn't a clear ah, still can compile?