CFileDialog,选择多个文件,得到文件名和路径,求代码,50分。

解决方案 »

  1.   

    看看MSDN里面的CFileDialog类构造函数说明不就得了
    这个也懒得去做?
      

  2.   

    POSITION pos = GetStartPosition();
    while (pos)
       CString strPath = GetNextPathName(pos);
      

  3.   


    void CxxxDlg::OnBnClickedBtnAddFiles()
    {
        CFileDialog dlgOpenFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT, _T("所有文件()|*.*||"));
        if (dlgOpenFileDialog.DoModal() == IDOK)
        {
            POSITION posFilePosition = dlgOpenFileDialog.GetStartPosition();
            while (posFilePosition != NULL)
            {
                CString sSelectFile = dlgOpenFileDialog.GetNextPathName(posFilePosition);
                AfxMessageBox(_T("MoreQuestion,这就是你要的:") + sSelectFile);        }
        }
    }
      

  4.   

    关于 CFileDialog 对话框多选功能的一个问题
    http://www.vckbase.com/document/viewdoc/?id=1544
      

  5.   

    路径是得到了C:\A.txt
    但我只想得到A.TXT。
      

  6.   

    LPTSTR PathFindFileName(
        LPCTSTR pPath
        );POSITION pos = GetStartPosition(); 
    while (pos) 
      CString strPath = PathFindFileName(GetNextPathName(pos));