Directory trees in List boxes

I am new to visual C++ and I am having a few problems.  Is it possible to have two list boxes on a dialog form where one displays the directory structure and the other displays the contents of the selected directory and a combo box displaying the current drive.  If this is possible how is it done?

Thanks Richard
LVL 1
Richard_EustaceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BinderCommented:
 Yes, you have all this objects in one ready for use. It´s CFileDialog and it
encapsulates the Windows File Box (it appears in almost every
program that needs to display a directory).
0
benzadonCommented:
Yes, you can create in a dialog more than one list, each one will be associate with a name (you can do that using the classwizzard) and you can handle the message and methods for each list. But for your case, my recomendation is to split the dialog in two: a tree view and a list view, exactly the way Microsoft Exprores does.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard_EustaceAuthor Commented:
To binder

Is there no way to get the controls onto a normal dialog.  i am trying to create lists of C++ files which I am then analysing the complexity of, the CFileDialog method is too repeative as yoy have to open it for each file. I need to use other controls at the same time and flicking between the two dialogs is tricky.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Richard_EustaceAuthor Commented:
To benzadon

I want to add other controls to the dialog and if i use an explorer view I dont have room for other controls.
0
benzadonCommented:
If I understand well, what you want is to create a dialog with two views and a combo box as Microsoft explorer has, where in the left view you wanna show the directory structure and when the user clicks a folder to show it folder contents in the right view. If it is the case, again the best way is using a tree view for the directory structure and a list view for the folder content. When the user clicks a folder in the tree control, you gonna receive the event and fill the list view. How you receive the message?, when you creates the tree control in the resource editor of VC++, using the right button of the mouse over the tree control select ClassWizard, there choose the event you wanna handle. You can do the same with the list. The combo box can be filled in the same moment you fill the list. About the space, it is not a problem, because first the both controls have horizontal scolls and second they have tooltips too.
0
benzadonCommented:
I forgot to tell you that it is very important to assign a variable for each control (tree, list and combo box). How you do that?, select the control with the right botton, choose ClassWizard, open the "Member Variables" tab, double-click the id of the variable and in the Category fill be sure to select Control, now from your Dialog class you can use the control using this variable.
0
Richard_EustaceAuthor Commented:
to benzadon
How do you get the tree view to display the directorr structure?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.