Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


directory listing in c++

This topic is 6803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If you want to use MFC, you can do this fairly easily using a CListBox::dir() function.

If you do not wish to use MFC, the regular windows way to do this is to use the FindFirstFile and FindNextFile() in a loop. You can specify wildcards in your search, so using the "*.*" method to find all files in a directory will work. You will also need to watch for subdirectories, as those will also appear in the search.

good luck


Share this post

Link to post
Share on other sites
Maybe you can use GetOpenFileName() (look it up in the msdn). It''s a common dialog control and I use it all the time.

But then again, it might not be suited for you because you are doing your own gui style thingy.

Jaap Suter

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!