tags:

views:

135

answers:

3
+1  Q: 

MFC Get Folders

Hey how do I in MFC get names of all folders? Any examples or which classes should I look into? Any hints will be really appreciated. All I saw is the CFile, which as far as I have seen (though very very little) doesn't looks like it has the ability to do what I want. So please direct me.

Thanks

+5  A: 

Look into CFileFind

There is an old article in DDJ on how to implement a recursive search using CFileFind.

Shay Erlichmen
Pay close attention to the IsDirectory member function.
Mark Ransom
+1  A: 

A Google search revealed an nice example in: Listing the Files in a Directory

It uses FindFirstFile, FindNextFile, and FindClose.

Jacob
This is the Windows API way to do it, not MFC.
Mark Ransom
+1  A: 

Look for FindFirstFile in the MFC documentation

dbrien