Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to implement DirListBox and DriveListBox in Visual C++ ?

How to implement DirListBox and DriveListBox in Visual C++ ?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vhmau
    wrote on last edited by
    #1

    Hi all, I need a dirlistbox and a drivelistbox in visual c++ dialog or some thing like that, so that user can show a dialog box and chose a directory path from my dialog. Tell me what to do ? thanks in advance.

    V D 2 Replies Last reply
    0
    • V vhmau

      Hi all, I need a dirlistbox and a drivelistbox in visual c++ dialog or some thing like that, so that user can show a dialog box and chose a directory path from my dialog. Tell me what to do ? thanks in advance.

      V Offline
      V Offline
      vcplusplus
      wrote on last edited by
      #2

      The following code will enumerate all the files in the current directory. CFileFind finder; BOOL bWorking = finder.FindFile("*.*"); while (bWorking) { bWorking = finder.FindNextFile(); myListBox.AddString(finder.GetFileName()) }or Use the method CListBox::Dir

      1 Reply Last reply
      0
      • V vhmau

        Hi all, I need a dirlistbox and a drivelistbox in visual c++ dialog or some thing like that, so that user can show a dialog box and chose a directory path from my dialog. Tell me what to do ? thanks in advance.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Wouldn't using SHBrowseForFolder() be easier?


        "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups