Does a browser dialog exist for MFC? 
Author Message
 Does a browser dialog exist for MFC?

Is there such a thing as a browse dialog in MFC like the CFileDialog or is
there a way to make the CFileDialog work with only directories?  I have an
application that needs to get a file path from the user.  This is kind of
like the browse button in the find files or folders program in NT 4.0 and
W95.  I have also tried the following code but it does not work:

   LPBROWSEINFO lpbi;
   char sBuf[_MAX_PATH];
   lpbi->hwndOwner = m_hWnd;
   lpbi->pidlRoot = NULL;
   lpbi->pszDisplayName = sBuf;
   lpbi->lpszTitle = "Output Path";
   lpbi->ulFlags = BIF_RETURNONLYFSDIRS;
   lpbi->lpfn = NULL;
   lpbi->lParam = NULL;
   lpbi->iImage = 0;
   SHBrowseForFolder(lpbi);

Any suggestions?

Thanks in advance,

Robert.



Fri, 28 Apr 2000 03:00:00 GMT  
 Does a browser dialog exist for MFC?

Quote:

> Is there such a thing as a browse dialog in MFC like the CFileDialog or is
> there a way to make the CFileDialog work with only directories?  I have an
> application that needs to get a file path from the user.  This is kind of
> like the browse button in the find files or folders program in NT 4.0 and
> W95.  I have also tried the following code but it does not work:

>    LPBROWSEINFO lpbi;
>    char sBuf[_MAX_PATH];
>    lpbi->hwndOwner = m_hWnd;
>    lpbi->pidlRoot = NULL;
>    lpbi->pszDisplayName = sBuf;
>    lpbi->lpszTitle = "Output Path";
>    lpbi->ulFlags = BIF_RETURNONLYFSDIRS;
>    lpbi->lpfn = NULL;
>    lpbi->lParam = NULL;
>    lpbi->iImage = 0;
>    SHBrowseForFolder(lpbi);

> Any suggestions?

> Thanks in advance,

> Robert.

  Hi,

There is a code sample which does the above at  www.codeguru.com/
Hope this helps.

Regards,
Madhav.



Sat, 29 Apr 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Derive a MFC dialog from an existing MFC Dialog

2. Does a browse directory dialog exist in MFC?

3. Enter key on dialog embedded in dialog not doing OnOK

4. Common Open Dialog not displaying a dialog when file doesn't exist

5. Non MFC modal dialogs in an MFC application - Dialog Message problem

6. Doing lookup with MFC Dao

7. Visual C++ hangs when doing custom build in MFC project

8. Modeless dialog - what am I doing wrong?

9. Eval of doing large project in VB or MFC

10. how to open new browser instance with an existing browser?

11. can this project be done easily in mfc ?

12. Attaching to an existing control to a dialog?

 

 
Powered by phpBB® Forum Software