Click here to Skip to main content
15,907,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Print menu selection Pin
ThatsAlok9-May-05 22:28
ThatsAlok9-May-05 22:28 
GeneralRecursive file listing Pin
__makaveli__9-May-05 4:23
__makaveli__9-May-05 4:23 
GeneralRe: Recursive file listing Pin
David Crow9-May-05 4:57
David Crow9-May-05 4:57 
GeneralRe: Recursive file listing Pin
__makaveli__9-May-05 5:02
__makaveli__9-May-05 5:02 
GeneralRe: Recursive file listing Pin
jmkhael9-May-05 5:49
jmkhael9-May-05 5:49 
GeneralRe: Recursive file listing Pin
__makaveli__9-May-05 5:56
__makaveli__9-May-05 5:56 
GeneralRe: Recursive file listing Pin
jmkhael9-May-05 6:04
jmkhael9-May-05 6:04 
GeneralRe: Recursive file listing Pin
__makaveli__9-May-05 6:17
__makaveli__9-May-05 6:17 
I have just tried that, I am getting somewhere now, at first I got a stack of messageboxes all saying ".\*", I have now added a check for dots but it's still not recursive.

I'm now using:
void SearchFolders(LPCTSTR wStart)
{
WIN32_FIND_DATA hDat;
HANDLE hFindFile;
char DirSpec[MAX_PATH];

ZeroMemory(DirSpec, MAX_PATH);
strncpy (DirSpec, wStart, strlen(wStart+1));
strncat (DirSpec, "\\*", 3);

hFindFile = FindFirstFile(DirSpec, &hDat);

if( hFindFile != INVALID_HANDLE_VALUE ) {
while( FindNextFile(hFindFile, &hDat) )
{
if( hDat.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {
// File is a folder
if( (strncmp(hDat.cFileName, ".", 1) != 0) || (strncmp(hDat.cFileName, "..", 2) != 0 ) ) {
char subDir[MAX_PATH];
strcat(subDir, hDat.cFileName);
strcat(subDir, "\\*");
SearchFolders(subDir);
}
} else {
// File is a file
MessageBox(0, hDat.cFileName, "File", MB_OK);
}
}
}
}


GeneralRe: Recursive file listing Pin
David Crow9-May-05 6:25
David Crow9-May-05 6:25 
GeneralRe: Recursive file listing Pin
Bob Stanneveld10-May-05 0:19
Bob Stanneveld10-May-05 0:19 
GeneralRe: Recursive file listing Pin
David Crow10-May-05 1:57
David Crow10-May-05 1:57 
GeneralRe: Recursive file listing Pin
Graham Bradshaw9-May-05 6:23
Graham Bradshaw9-May-05 6:23 
GeneralRe: Recursive file listing Pin
Kelly Herald9-May-05 17:32
Kelly Herald9-May-05 17:32 
GeneralRe: problem in capturing packet Pin
jmkhael9-May-05 6:12
jmkhael9-May-05 6:12 
GeneralRe: problem in capturing packet Pin
jmkhael9-May-05 22:15
jmkhael9-May-05 22:15 
GeneralWaitForSingleObject Pin
Alex_Y9-May-05 3:41
Alex_Y9-May-05 3:41 
GeneralRe: WaitForSingleObject Pin
Blake Miller9-May-05 5:02
Blake Miller9-May-05 5:02 
GeneralRe: WaitForSingleObject Pin
Alex_Y9-May-05 6:59
Alex_Y9-May-05 6:59 
Generalc++ question. Please help Pin
Hoornet939-May-05 2:37
Hoornet939-May-05 2:37 
GeneralRe: c++ question. Please help Pin
BlackDice9-May-05 2:52
BlackDice9-May-05 2:52 
GeneralRe: c++ question. Please help Pin
Hoornet939-May-05 5:15
Hoornet939-May-05 5:15 
GeneralRe: c++ question. Please help Pin
BlackDice9-May-05 5:24
BlackDice9-May-05 5:24 
GeneralRe: c++ question. Please help Pin
Hoornet939-May-05 5:56
Hoornet939-May-05 5:56 
GeneralRe: c++ question. Please help Pin
BlackDice9-May-05 6:07
BlackDice9-May-05 6:07 
GeneralRe: c++ question. Please help Pin
David Crow9-May-05 2:53
David Crow9-May-05 2:53 

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.