Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MFC - search for files in a directory and display results

Posted on 2004-08-19
1
Medium Priority
?
484 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 375 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

688 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