RSS Forums RSS
Please support our C++ advertiser: Programming Forums

how to read file names from a folder

Join Date: Dec 2004
Posts: 13
Reputation: britt_boy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
britt_boy britt_boy is offline Offline
Newbie Poster

Re: how to read file names from a folder

  #3  
Dec 7th, 2004
Heres a snippet in mfc for finding a file of form *.extension in directory = myDirectory

   // Get a list of files
   CFileFind finder;
   BOOL finding = finder.FindFile (myDirectory + CString ("\\*.") + extension);
   
   //iterate the results
   while (finding)
    {
      finding = finder.FindNextFile();
    
      //get file path
      CString path = finder.GetFilePath());
     
      //get file title
      CString title = finder.GetFileTitle() 
    }

    //dont forget to close
    finder.Close ();
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 9:10 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC