Click here to Skip to main content
15,919,178 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralReading checkboxes in excel spreadsheet Pin
shultas26-Jan-05 9:18
shultas26-Jan-05 9:18 
GeneralRe: Converting text to float (MFC) Pin
Tom Wright26-Jan-05 9:15
Tom Wright26-Jan-05 9:15 
GeneralRetrieving number of directories Pin
FayezElFar26-Jan-05 8:55
FayezElFar26-Jan-05 8:55 
GeneralRe: Retrieving number of directories Pin
David Crow26-Jan-05 9:44
David Crow26-Jan-05 9:44 
GeneralRe: Retrieving number of directories Pin
FayezElFar26-Jan-05 10:12
FayezElFar26-Jan-05 10:12 
GeneralRe: Retrieving number of directories Pin
David Crow26-Jan-05 10:18
David Crow26-Jan-05 10:18 
GeneralRe: Retrieving number of directories Pin
FayezElFar26-Jan-05 10:29
FayezElFar26-Jan-05 10:29 
GeneralRe: Retrieving number of directories Pin
David Crow26-Jan-05 10:41
David Crow26-Jan-05 10:41 
You might ask Chris Losinger if he has any performance suggestions.

In the interim, see if you can build upon this:

int FindFiles( LPCSTR lpszFolder )
{
    CString strFolder(lpszFolder);
    CFileFind find;
    BOOL bFound;
    int nCount = 0;
 
    bFound = find.FindFile(strFolder + "\\*.*");
    while (TRUE == bFound)
    {
        bFound = find.FindNextFile();
 
        if (find.IsDirectory() == TRUE)
        {
            if (! find.IsDots())
                nCount += FindFiles(find.GetFilePath());
        }
        else
        {
            // there are better ways of comparing, but this gives you an idea
            if (find.GetFileName().Right(4) == ".txt")
                nCount++;
        }
    }
 
    return nCount;
}
...
int x = FindFiles("c:\\winnt");



"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


GeneralRe: Retrieving number of directories Pin
JKallen26-Jan-05 12:42
JKallen26-Jan-05 12:42 
GeneralRe: Retrieving number of directories Pin
FayezElFar27-Jan-05 5:01
FayezElFar27-Jan-05 5:01 
GeneralCannot covert parameter - __stdcall Pin
User 137680026-Jan-05 8:41
User 137680026-Jan-05 8:41 
GeneralRe: Cannot covert parameter - __stdcall Pin
David Crow26-Jan-05 9:48
David Crow26-Jan-05 9:48 
GeneralRe: Cannot covert parameter - __stdcall Pin
User 137680026-Jan-05 10:21
User 137680026-Jan-05 10:21 
GeneralRe: Cannot covert parameter - __stdcall Pin
trelliot27-Jan-05 18:23
trelliot27-Jan-05 18:23 
GeneralSplitter window title Pin
mdave26-Jan-05 7:55
mdave26-Jan-05 7:55 
GeneralRe: Splitter window title Pin
Tom Wright26-Jan-05 9:25
Tom Wright26-Jan-05 9:25 
GeneralRe: Splitter window title Pin
mdave26-Jan-05 9:38
mdave26-Jan-05 9:38 
GeneralProblem with storing values Pin
RedDragon2k26-Jan-05 6:54
RedDragon2k26-Jan-05 6:54 
GeneralRe: Problem with storing values Pin
David Crow26-Jan-05 7:04
David Crow26-Jan-05 7:04 
GeneralRe: Problem with storing values Pin
RedDragon2k26-Jan-05 7:07
RedDragon2k26-Jan-05 7:07 
GeneralRe: Problem with storing values Pin
David Crow26-Jan-05 7:13
David Crow26-Jan-05 7:13 
GeneralRe: Problem with storing values Pin
RedDragon2k26-Jan-05 7:15
RedDragon2k26-Jan-05 7:15 
GeneralRe: Problem with storing values Pin
David Crow26-Jan-05 7:35
David Crow26-Jan-05 7:35 
GeneralRe: Problem with storing values Pin
RedDragon2k26-Jan-05 7:40
RedDragon2k26-Jan-05 7:40 
GeneralRe: Problem with storing values Pin
David Crow26-Jan-05 7:45
David Crow26-Jan-05 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.