Posted on 2011-08-20 12:27
eamon 阅读(726)
评论(0) 编辑 收藏 引用 所属分类:
程序设计
POSITION pos;
CString strFilename;
CFileDialog FileDlg(TRUE,"txt",NULL,OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_EXPLORER|OFN_ALLOWMULTISELECT, "Text Files(*.txt)|*.txt|All Files(*.*)|*.*|");
FileDlg.m_ofn.nMaxFile = 100 * MAX_PATH; //100 Files
FileDlg.m_ofn.lpstrFile = new TCHAR[FileDlg.m_ofn.nMaxFile];
ZeroMemory(FileDlg.m_ofn.lpstrFile, sizeof(TCHAR) * FileDlg.m_ofn.nMaxFile);
if(FileDlg.DoModal() == IDOK)
{
pos = FileDlg.GetStartPosition();
while(pos)
{
strFilename = FileDlg.GetNextPathName(pos);
AfxMessageBox(strFilename);
}
}