Obtaining directory listings

This is a discussion on Obtaining directory listings within the Windows Programming forums, part of the Platform Specific Boards category; Are the FindFirstFile() and FindNextFile() functions the best way to obtain a directory listing?...

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    Obtaining directory listings

    Are the FindFirstFile() and FindNextFile() functions the best way to obtain a directory listing?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Yes. I have a tutorial on their use if you need one. Here.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is to determine the file attribute and process only folders.

    if (dataList.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
    {
    }

    Kuphryn

  4. #4
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I have a problem with Search Companion in Windows XP professional. When I am not logged onto the internet, and I try to use the Search Companion in any way, such as pressing Start-F or Ctrl-F, it tells me "a file is missing that is required to run Search Companion. Run setup". Basically, when I'm not on the net, I can't search for files at all, which is annoying. If I were to create a search program using FindFirstFile() and FindNextFile(), would that be the most efficient way? Also, if anyone knows how to fix the Search Companion problem, I'd love to know how.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Can you not put your XP cd in and choose the "Repair" option to put back the file, (I can't quite remember what the option is called, it is something like that, I remember seeing it when I reinstalled last time).

    I would use FindFirstFile()/FindNextFile() to search or list files.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I couldn't find that option on the CD. Are you sure it's possible? If not I guess I'll either reinstall or make my own search program.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  7. #7
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Don't worry, I found an MSDN article that explained the error. Some files can become corrupted or become "missing", if you use search companion with some internet service providers. To fix it, you need to find the srchasst.inf file in the windows\inf\ folder. Right click and press install, and it's done (requires CD). Handy thing, MSDN. Though I wonder if there IS a repair function somewhere. That would be even more handy. Thanks for the help.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to tell if a file or directory
    By swappo in forum C++ Programming
    Replies: 4
    Last Post: 07-07-2009, 11:57 AM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 10:38 AM
  3. Couple errors please help :-D
    By JJJIrish05 in forum C Programming
    Replies: 9
    Last Post: 03-06-2008, 02:54 AM
  4. Replies: 6
    Last Post: 07-30-2003, 04:08 AM
  5. Directory reading trouble
    By samGwilliam in forum Linux Programming
    Replies: 0
    Last Post: 03-10-2002, 09:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21