CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Finding Files

  1. #1
    Join Date
    May 1999
    Location
    Raleigh, NC
    Posts
    47

    Finding Files

    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.



  2. #2
    Join Date
    May 1999
    Posts
    69

    Re: Finding Files

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured