Link to home
Start Free TrialLog in
Avatar of necroticworld
necroticworld

asked on

Reading directories in MFC

I recently have been working on a c++ client server program, the beta version of the server is complete, and I'm working on the client, but the client i would like to create in MFC for visual effects. One problem i found is that I need to read in the content of a Directory. I found a way in C++ to do this unsing opendir(), readdir() and a few other functions. I wrote a Directory class to make it easier, but now in MFC i can't use any of the opendir() or readdir() functions because they use c++ files that won't work with MFC. the problem occurred in including the files sys/types.h and dirent.h. Is there any way to get this to work, or to read a directory using MFC functions. I would like if possible to do this all in code and not dialog boxes, so lets assume that the folder name is in a char *. any way i can do this?
ASKER CERTIFIED SOLUTION
Avatar of jackrabbit22
jackrabbit22

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jackrabbit22
jackrabbit22

Forget something...

Add this line after the do/while loop:

FindClose(handle);
Avatar of necroticworld

ASKER

Thanx that helped alot.