Solved

MFC - search for files in a directory and display results

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pre4 challenge 19 100
EvenOdd challenge 10 108
Problem to open Excel file 15 134
Is there a simple front-end menu system. 9 89
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

777 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