User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 427,847 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,759 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 11740 | Replies: 2
Reply
Join Date: Oct 2004
Posts: 3
Reputation: sachin kumar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sachin kumar sachin kumar is offline Offline
Newbie Poster

how to read file names from a folder

  #1  
Dec 7th, 2004
can anyone help me in reading the file names from a folder with a specific extention in VC++ enviroment.

thanks in advance
sachin
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Rep Power: 11
Solved Threads: 102
Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: how to read file names from a folder

  #2  
Dec 7th, 2004
Have you written anything yourself on this?

We usually help you troubleshoot your code, not write it for you.
Alex Cavnar, aka alc6379
Reply With Quote  
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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:15 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC