Solved

MFC - search for files in a directory and display results

Posted on 2004-08-19
1
459 Views
Last Modified: 2013-11-20
I have a tree view control that lists directories
the user selects a directory he wants to search files in
 so now the directory path is available in a CString variable.

Now i want to have a text box titled "Search for".... wherein you would give the pattern of the file to serach for.
the program should serach for the file (with wild cards and stuff) in that directory and sipaly results ina listbox.


could someone tell me how i could do the search files part.
I have already have the directory path avaialbe in a variable.


Please do help me with this
0
Comment
Question by:vikasgkutty
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 11843260
You could  use

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/listing_the_files_in_a_directory.asp ("Listing the Files in a Directory")

or

http://www.codeproject.com/file/cfilefinderex.asp ("CFileFinder - Extend the functionality of CFileFind MFC class")
http://www.codeproject.com/cpp/enumeratefolders.asp ("A class to make it easy to enumerate folder contents")

BTW, also check out 'CWnd::DlgDirList()'.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 73
Process filename extension 3 196
mapAB Challlenge 35 160
Capture logon name 13 88
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question