打开文件对话框,如何实现可以选取多个文件,然后将这些多个文件的名字和路径添加到一个
列表框中
列表框中
解决方案 »
- 能不能不调用OnPaint函数,往静态静态文本框上写字
- 在view里面设置对话框中combox的默认值
- CATCH_ALL中的ASSERT
- 高手请进,函数运行完后,弹出对话框,提示该程序遇到问题,需要关闭
- socket问题两个
- 菜鸟提问:如导出DLL中的MFC的派生类?
- 请问各位大虾,可以推荐一个开源的图形库给我吗?可以做到和matlab图形库类似的功能!
- 用msxml写一个xml文档,怎样让输出文当清楚好看(就是包含TAB键空格和换行)
- 请问怎么样分配得到一块比较的的内存空间?比如10M左右。
- 急找一个好的VC连SQL的KTV点歌系统30分悬赏啊
- 如何自动接受socket中返回的数据?
- 请问如何在对话框建立后自动触发IDOK,放在哪里比较合适
If the user selects more than one file, the lpstrFile buffer returns the path to the current directory followed by the filenames of the selected files. The nFileOffset member is the offset, in bytes or characters, to the first filename, and the nFileExtension member is not used. For Explorer-style dialog boxes, the directory and filename strings are NULL separated, with an extra NULL character after the last filename. This format enables the Explorer-style dialogs to return long filenames that include spaces. For old-style dialog boxes, the directory and filename strings are separated by spaces and the function uses short filenames for filenames with spaces. You can use theFindFirstFile function to convert between long and short filenames.
DWORD dwFlags = OFN_FILEMUSTEXIST|OFN_ALLOWMULTISELECT;
CFileDialog dlg(TRUE, NULL, NULL, dwFlags, FileFilter);
if (dlg.DoModal()==IDOK)
{
POSITION pos=dlg.GetStartPosition();
while(pos!=NULL)
{
CString FileName="";
FileName = dlg.GetNextPathName(pos);
// 添加到列表框;
}
}