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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFileDialog File Order Selection

Status
Not open for further replies.

CasperTheGhost

Programmer
Mar 21, 2002
8
US
How do you get the correct file order selection from CFileDialog?

When selecting multiple-files (OFN_ALLOWMULTISELECT flag set) the string returned (using GetStartPosition, GetNextPathName, etc) is NOT necessarily the selected file order? Example: select 1.txt, 2.txt, 3.txt from the OPEN dialog and the edit box shows the order as 3.txt, 2.txt and 1.txt. Thinking simply reversing the string?, thought of that - there are numerous ways of selecting files from a folder (ctrl, shift, etc.) and they all either reverse the file order selection or insert into the string randomly depending if you select down a column or the far right, etc.
Any help would be appreciated in advance.....
 
I see what you're talking about. There seems to be no way to control the sequence.

Workaround:

You may wish to insert all files selected from the CFileDialog control into a list box on a parent dialog, which would have UP/DOWN arrows to allow the user to move the selected filenames to the proper sequence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top