Link to home
Start Free TrialLog in
Avatar of simongod
simongod

asked on

loading in file names

I want to take the names of a bunch of files and load them into listbox control in VC++.

Here is an example

test1.emf
test2.emf

I want the test1 and test2 part of the file name to show up in the listbox control.  If I add more files then those name will be loaded into the listbox without having to recompile the program.
ASKER CERTIFIED SOLUTION
Avatar of captainkirk
captainkirk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of simongod
simongod

ASKER

can you actually write the code for me or be more specific?  What you tell me will work but I need specifics.  I don't really have time for "brainstorming", I just want some code.  If you write the code then I will up the pts by 50.
I should ask a couple of questions:

1) What is to be the source of the filenames??

2) if the source of the filenames is a directory search (if you want to search a particular directory subtree), then do you want an entry edit box to specify that start directory??

the program is dialog based, when it starts the program searches through the subdirectories located only in the same path as the program.  It only searches for EMF type files.  then it should take the name of the file and load it into a listbox or combobox control.

example -

directory = new
program name = new.exe
subdir = block

this is the actual directory that I want searched.  It contains a few more dir's, but each one contains emf files.  Any emf file that is added to the block dir will be displayed in the listbox or combo box (preferably listbox)  I don't want the emf part of the file name to be displayed just the first part of the name.

test1.emf
test2.emf
test3.emf

only test1, test2, test3 will be shown not the emf part of the file.  IU would like it to be in decending order.  No left to right and decending stuff, just decending.

1) The comment has your list in ascending order - you would like to see it like:

test4
test3
test2
test1

2) do you want to dynamically specify the starting directory (like in a file selection dialog)?
no the search should only be in subdir of where the program resides.
i am using winnt does that make a difference?
thanks...