Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:50:27+00:00 2026-05-27T05:50:27+00:00

I would like to know how to list all folder in a directory in

  • 0

I would like to know how to list all folder in a directory in a listbox. I am using Visual C++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:50:27+00:00Added an answer on May 27, 2026 at 5:50 am

    C++ is a language that does not specify any standard classes or functions for implementing graphical interfaces. It also doesn’t provide a standard way of getting lists of files and directories from the operating system!!! In fact…for a long time there wasn’t even a standard for string classes, and every project chose different incompatible strings.

    Note: Even though there’s now a standard string class, the fragmented legacy continues: Why is there a different string class in every C++ platform out there?

    So when you tag something “C++” or use that term, it refers only the language engine itself. As limited as that may sound, one of the great strengths is that this engine is so (relatively) powerful that you don’t need to build things in to make them efficient or have a deep coding interface. Users of the language have nearly as much power to create cool language features as if they were able to modify the compiler itself.

    It’s a steep hill to climb for beginners, though.


    All of that means that a question like “How to populate a Listbox in C++ with all folders in a directory?” is very open-ended. It depends on what toolkits you’re choosing to use for the GUI, and for talking to the filesystem. Some toolkits are “big” and offer comprehensive classes to cover both areas:

    http://doc.qt.nokia.com/latest/qdir.html#navigation-and-directory-operations

    http://doc.qt.nokia.com/latest/itemviews-dirview.html

    Other libraries are more narrow and provide just one function or another. For instance, “boost” is a set of almost standard libraries that haven’t yet made it into the C++ spec. There’s a way to enumerate files and directories with C++ using boost::filesystem. It’s daunting for beginners, though:

    http://www.boost.org/doc/libs/1_48_0/libs/filesystem/v3/doc/tutorial.html

    If you’re willing to chain yourself to a particular operating system or implementation–such as make calls to functions only available on Windows, or only on Linux under GTK, or only on MacOS–then you have access to what that platform+toolkit provides. But because C++ is platform-independent, once you cross that line you’re no longer programming in “just C++” and your question and tags on StackOverflow need to clarify what choices you’ve made.

    Your other questions on SO are about Visual Studio and VB so I’m assuming you’re using Windows.


    One related topic you should be aware of are “common dialogs”. These are conveniences provided so that everyone doesn’t have to write their own “File->Open” logic, or color picker, or search dialog. Microsoft has some of them defined on Windows:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms646960(v=VS.85).aspx

    So if picking a file, files, directory, or directories is the simple purpose of some code…those save you the trouble. Qt has similar things:

    http://doc.qt.nokia.com/stable/qfiledialog.html#details


    You can edit your question to add more about your purposes. If you are curious about C++ and just want to dive in and have a well-documented set of functionality that will work on Windows, Mac, or Linux… consider trying Qt Creator:

    http://www.qt.io/ide/

    Microsoft has really hinged their strategy on .NET and C#, so at least right now you’ll stand on firmer ground as a C++ GUI programmer if you go with Qt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how to list all functions of a Clojure namespace.
I would like to know, how can we ordered the list using order by
I would like to know where I can find the list of properties settable
I would like to know how I can refer to a list item object
After I move (sort) one of my list items I would like to know
I would like to know if I can open 2 different diagrams using MS
I am using jQuery 1.6 and I would like to know and understand how
I'm using SQL Server 2005 and would like to know how I can get
I would like to know all possible attributes of an element in JS. I
Similar to this question , I would like to know how to generate all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.