MFC打开或者保存文件
2012-11-01 10:26 龙成 阅读(598) 评论(0) 编辑 收藏 举报1 CFileDialog file(TRUE,"txt","d");//false为保存 2 file.m_ofn.lpstrTitle = "保存文件筐?"; 3 file.m_ofn.lpstrFilter = _T("doc,rar\0*.doc;*.rar\0txt\0*.txt\0all\0*.*"); 4 file.m_ofn.Flags |= OFN_ALLOWMULTISELECT; 5 // file.m_ofn.lpstrDefExt = _T("txt"); 6 // file.m_ofn.lpstrFileTitle = "d"; 7 8 file.DoModal(); 9 POSITION pos; 10 pos = file.GetStartPosition(); 11 while(pos) 12 { 13 MessageBox(file.GetNextPathName(pos)); 14 }