请问MFC里面有没有显示路径,并可以选择路径的类?不是CFileDialog

解决方案 »

  1.   

    ATL中的CPathT Class.
    SDK中有一些函数例如:GetFullPathName、GetCurrentDirctory等函数。
      

  2.   

    SDK中你看看File Management Functions
      

  3.   

    SHBrowseForFolder is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application
      

  4.   

    使用这个 Shell APILPITEMIDLIST SHBrowseForFolder(
    LPBROWSEINFO lpbi
    ); #include <shellapi.h>  // using shell32.lib例子参考 MSDN "Getting a Folder's ID" 和以下代码IMalloc * pMalloc = NULL;
    SHGetMalloc(&pMalloc);LPITEMIDLIST pidl = SHBrowseForFolder(...);TCHAT tszPath[MAX_PATH];
    SHGetPathFromIDList(pidl, tszPath);pMalloc->Free(pidl);
    pMalloc->Release();
      

  5.   

    TCHAR m_buffer[255];
    BROWSEINFO m_pbi ;
    ::ZeroMemory(&m_pbi, sizeof(BROWSEINFO));
    m_pbi.hwndOwner = GetSafeHwnd();
    m_pbi.pszDisplayName = m_buffer;
    m_pbi.lpszTitle = "素材路径";
    m_pbi.ulFlags = BIF_RETURNONLYFSDIRS; ITEMIDLIST *idl = SHBrowseForFolder(&m_pbi);
    if (idl)
    {
    SHGetPathFromIDList (idl, m_buffer); // get path string from ITEMIDLIST
            lstrcpy(IniItemPath[m_DirectIndex],m_buffer);
    SetDlgItemText(IDC_BROWSEDIRECTORY,IniItemPath[m_DirectIndex]);
           //m_SList.AddString(m_buffer);  
    }