loading ALL files in a dir

Alright, so i make a loader… it loads in .dan files (.ase converted to my own file format)… i want to, when i start a program, have the program find ALL the .dan files in its directory, and then load each of them into its database… how can i get C++ to look through its dir, and open each file that ends with .dan?

If you are working on Win32, I believe you can use a combination of FindFirstFile and FindNextFile to search a directory for a filename (which I believe can include wildcards).

i dont exactly know how to use those… can u gimme an example code?

You can check out msdn:


  • VC6-OGL