directory listing in c++
I need to get a list of all the files in a directory, how can I accmoplish this through c++. ( I am using MSVC 5.0 and this is a win application )
- OneEyeLessThanNone
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
*oof*
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
*oof*
*oof*
Thanks, gonna have to try that out when I get home, 2.5 hours left till my next class, and nothing to do.
"complexity killed the cat" - someone
"complexity killed the cat" - someone
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
But then again, it might not be suited for you because you are doing your own gui style thingy.
Jaap Suter
____________________________Mmmm, I''ll have to think of one.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement