我要实现的是,在list中选中两个文件,然后点击 复制视频 button,出现CFileDialog,使用SHFILEOPSTRUCT进行复制。我以前单个复制可以将文件名自动赋值给 CFiledialog,作为同文件的目的文件名,可现在是多个,CFileDialog只能一对一,如何解决啊?我的思路是 选中点击出对话框,选择目的地址?不知有没有实现方法?

解决方案 »

  1.   

    BROWSEINFO m_bi
    ::SHBrowseForFolder(&m_bi);记得是这个
      

  2.   

    修改:
    CFileDialog::m_ofn  成员typedef struct tagOFN { 
      DWORD         lStructSize; 
      HWND          hwndOwner; 
      HINSTANCE     hInstance; 
      LPCTSTR       lpstrFilter; 
      LPTSTR        lpstrCustomFilter; 
      DWORD         nMaxCustFilter; 
      DWORD         nFilterIndex; 
      LPTSTR        lpstrFile; 
      DWORD         nMaxFile; 
      LPTSTR        lpstrFileTitle; 
      DWORD         nMaxFileTitle; 
      LPCTSTR       lpstrInitialDir; 
      LPCTSTR       lpstrTitle; 
      DWORD         Flags; 
      WORD          nFileOffset; 
      WORD          nFileExtension; 
      LPCTSTR       lpstrDefExt; 
      LPARAM        lCustData; 
      LPOFNHOOKPROC lpfnHook; 
      LPCTSTR       lpTemplateName; 
    #if (_WIN32_WINNT >= 0x0500)
      void *        pvReserved;
      DWORD         dwReserved;
      DWORD         FlagsEx;
    #endif // (_WIN32_WINNT >= 0x0500)
    } OPENFILENAME Flags 
    OFN_ALLOWMULTISELECT :Specifies that the File Name list box allows multiple selections
      

  3.   

    修改:
    CFileDialog::m_ofn  成员typedef struct tagOFN { 
      DWORD         lStructSize; 
      HWND          hwndOwner; 
      HINSTANCE     hInstance; 
      LPCTSTR       lpstrFilter; 
      LPTSTR        lpstrCustomFilter; 
      DWORD         nMaxCustFilter; 
      DWORD         nFilterIndex; 
      LPTSTR        lpstrFile; 
      DWORD         nMaxFile; 
      LPTSTR        lpstrFileTitle; 
      DWORD         nMaxFileTitle; 
      LPCTSTR       lpstrInitialDir; 
      LPCTSTR       lpstrTitle; 
      DWORD         Flags; 
      WORD          nFileOffset; 
      WORD          nFileExtension; 
      LPCTSTR       lpstrDefExt; 
      LPARAM        lCustData; 
      LPOFNHOOKPROC lpfnHook; 
      LPCTSTR       lpTemplateName; 
    #if (_WIN32_WINNT >= 0x0500)
      void *        pvReserved;
      DWORD         dwReserved;
      DWORD         FlagsEx;
    #endif // (_WIN32_WINNT >= 0x0500)
    } OPENFILENAME Flags 
    OFN_ALLOWMULTISELECT :Specifies that the File Name list box allows multiple selections
      

  4.   

    我可能没有讲清楚,我现在源文件路径已经都获取了,放入一个CStringArray中,我打开CFileDialog的目的就是选择要复制的目的地址,我原来一对一的思路是直接截取 文件名.文件类型 ,现在我有多个文件名不知如何处理