16,551
社区成员
发帖
与我相关
我的任务
分享
void CChildView::OnAppOpen()
{
// TODO: Add your command handler code here
CStringArray m_file_name_list;
m_file_name_list.RemoveAll();
static char BASED_CODE szFilter[] = "Chart Files (*.xlc)|*.xlc|Worksheet Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files (*.*)|*.*||";
CFileDialog dlg(TRUE,// TRUE for FileOpen, FALSE for FileSaveAs
NULL, // If this parameter is NULL, no file extension is appended.
NULL, // If NULL, no filename initially appears.
OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
// Specifies that the File Name list box allows multiple selections.
szFilter // Specify filters you can apply to the file.
);
TCHAR buffer[3000];
memset(buffer,0,3000);
dlg.m_ofn.lpstrFile = buffer;
dlg.m_ofn.nMaxFile = 3000;
if (IDOK == dlg.DoModal())
{
CString file_name;
POSITION pos = dlg.GetStartPosition();
while (pos != NULL)
{
CString file_name = dlg.GetNextPathName(pos);
m_file_name_list.Add(file_name);
}
}
else
{
}
}