关于文件打开对话框选择多个文件时的设置:
#define MAX_BUFFER (63 * 1024)
CFileDialog cfd(TRUE, "*.*", NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST,
szFilter, NULL);
cfd.m_ofn.lpstrFile = new TCHAR[MAX_BUFFER];
cfd.m_ofn.lpstrFile[0] = 0;
cfd.m_ofn.nMaxFile = MAX_BUFFER;
fd.m_ofn.nMaxFile = 2560;
char pc[2560];
fd.m_ofn.lpstrFile = pc;
fd.m_ofn.lpstrFile[0] = NULL;
if(fd.DoModal()==IDOK)
{
}
这样就可以了。。以前不行就是因为少了fd.m_ofn.lpstrFile[0] = NULL;这句。。
#define MAX_BUFFER (63 * 1024)
CFileDialog cfd(TRUE, "*.*", NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST,
szFilter, NULL);
cfd.m_ofn.lpstrFile = new TCHAR[MAX_BUFFER];
cfd.m_ofn.lpstrFile[0] = 0;
cfd.m_ofn.nMaxFile = MAX_BUFFER;
fd.m_ofn.nMaxFile = 2560;
char pc[2560];
fd.m_ofn.lpstrFile = pc;
fd.m_ofn.lpstrFile[0] = NULL;
if(fd.DoModal()==IDOK)
{
}
这样就可以了。。以前不行就是因为少了fd.m_ofn.lpstrFile[0] = NULL;这句。。