Getting A List Of Files In A Directory
My 3D engine needs to be able to get a list of files in a given directory.
I can''t figure out how it''s done without MFC?
Does anyone here have any clue?
------------------------------------------------------------I wrote the best video game ever, then I woke up...
I had to do this for my game too, so if u need clarification, plz post again.
here is the general format:
In the do loop, you can enumerate the files etc..., in my application I call the function again recursively for subdirectories.
wfd will contain information about the current element. i make use of the following properties in my code:
This i use to check if it is a subdirectory
This if it is just a normal file
Notice, u need to use the & to check for flags in the file attributes. wfd.cFileName is also useful. I would reccommend looking up the WIN32_FIND_DATA structure on MSDN, it has a lot of stuff, and is well documented. You can find out all the same stuff that the MFC FindFile thingy gives you.
Good luck, post again if you have further questions.
here is the general format:
|
In the do loop, you can enumerate the files etc..., in my application I call the function again recursively for subdirectories.
wfd will contain information about the current element. i make use of the following properties in my code:
This i use to check if it is a subdirectory
|
This if it is just a normal file
|
Notice, u need to use the & to check for flags in the file attributes. wfd.cFileName is also useful. I would reccommend looking up the WIN32_FIND_DATA structure on MSDN, it has a lot of stuff, and is well documented. You can find out all the same stuff that the MFC FindFile thingy gives you.
Good luck, post again if you have further questions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement