Results 1 to 3 of 3

Thread: Browse for folder the MFC way

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471

    Browse for folder the MFC way

    Anyone know the correct way to implement a browse for folder
    dialog with MFC?
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Take a look at CListBox, :lgDirList and :lgDirSelectEx. This should give you all the knowledge you need to build your own directory selection dialog.

    A more modern way involves CListBox (owner drawn with strings), CComboBoxEx and the ::Find*File family. Or maybe the shell namespace. To make a directory selection box in real modern explorer style, use SHGetDesktopFolder to retrieve a IShellFolder interface pointer. Use this interface to walk the complete directory tree (the EnumObjects and BindToObject methods mainly). The retrieved information should be displayed in a tree control.

    Sorry, I can't give you any code, this will require some time to learn...

    The simplest method (the one listed at the top) can be looked up for API way at
    Platform SDK->User Interface Services->Controls->List Boxes->Using List Boxes->Creating a Directory Listing in a Single-Selection List Box

    It lists a complete DlgProc for a dialog that does just this. It shouldn't be too hard to translate that to MFC, but be aware that it looks like a relic from Win16
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    yeah unfortunately i chose to go the API way, however in my
    search i found some code at codeguru where someone
    wrapped the SHBrowseForFolder API for MFC

    i'm changing that a bit around now for my likings, thx again
    Bababooey
    Tatatoothy
    Mamamonkey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width