Click to See Complete Forum and Search --> : Finding Files


jmgreene
May 21st, 1999, 10:30 AM
I am using this source code to search for a file extension:
while (bWorking)
{ bWorking = finder.FindNextFile();
CListBox::AddString(LPCTSTR finder.GetFileTitle()); }

The LPCTSTR is giving me an error: illegal use of this tyep....
Also does anyone know how to search subdirectories as well?

Thanks.

Rob Wainwright
May 21st, 1999, 05:01 PM
You don't need the LPCTSTR in the statement. Try.

while (bWorking)
{ bWorking = finder.FindNextFile();
CListBox::AddString(finder.GetFileTitle()); }

You need a recursive algorithm for traversing subdirectories. The Advanced Windows book by Richter has an SDK sample for doing this