Thread: Obtaining directory listings

  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?
    [email protected]
    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,829
    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.
    [email protected]
    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,829
    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.
    [email protected]
    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.
    [email protected]
    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, 10:57 AM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09: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, 03:08 AM
  5. Directory reading trouble
    By samGwilliam in forum Linux Programming
    Replies: 0
    Last Post: 03-10-2002, 09:43 AM