CString filepath;
CFileDialog Filedlg(TRUE,
NULL,
NULL,
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT |
OFN_ALLOWMULTISELECT|OFN_EXPLORER,
"Data Files (*.bak;*.txt)|*.bak;*.txt|All files(*.*)|*.*||",
NULL);
TCHAR *pBuffer = new TCHAR[MAX_PATH * 100];//最多允许100个文件
Filedlg.m_ofn.lpstrFile = pBuffer;
Filedlg.m_ofn.nMaxFile = 100*MAX_PATH;
Filedlg.m_ofn.lStructSize = 88;
if(Filedlg.DoModal() == IDOK)
{
POSITION pos = Filedlg.GetStartPosition();
while(pos != NULL)
{
filepath = Filedlg.GetNextPathName(pos);
// .....
}
}
CFileDialog Filedlg(TRUE,
NULL,
NULL,
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT |
OFN_ALLOWMULTISELECT|OFN_EXPLORER,
"Data Files (*.bak;*.txt)|*.bak;*.txt|All files(*.*)|*.*||",
NULL);
TCHAR *pBuffer = new TCHAR[MAX_PATH * 100];//最多允许100个文件
Filedlg.m_ofn.lpstrFile = pBuffer;
Filedlg.m_ofn.nMaxFile = 100*MAX_PATH;
Filedlg.m_ofn.lStructSize = 88;
if(Filedlg.DoModal() == IDOK)
{
POSITION pos = Filedlg.GetStartPosition();
while(pos != NULL)
{
filepath = Filedlg.GetNextPathName(pos);
// .....
}
}