Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFileFind and the order of search results

Status
Not open for further replies.

dcswee

Programmer
Jan 23, 2002
13
0
0
GB
Can anyone help, I'd like to be able use the CFileFind class to find C:\dir\*.txt , ordering the results in order of date.

Other than searching through the whole list of files and noting which one is the most recent (or subclassing CFileFind), is there a quick and easy way to order the search results in CFileFind::FindFile?

If there's a win32 api for this, what is it called?
 
Not that I know of, but here is what I would do to see if there is a way.

1. Go to the folder in question and order it by name. See if CFileFind will get them alphabetically.

2. Order by date and see how CFileFind retrieves them.

If it is by the current view config of the folder, I assume that there is an API call you can make to order by date. If not, then you will most likely need to impliment the child class with a cfilestatus structure.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top