Solved

MFC - search for files in a directory and display results

Posted on 2004-08-19
1
449 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 30
viewing source code from eclipse 13 74
Annoying "thing" blocks my view 4 50
Making an alias 7 52
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now