Solved

CTreeCtrl

Posted on 1998-11-28
2
388 Views
Last Modified: 2013-11-20
How can I make a windows explorer type tree control.  I want it to populate with only directories.  I used the FTPTREE example but for some reason it will only go two directories deep....  weird.

I need a control to browse directories...

any help?
0
Comment
Question by:brosoft
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 100 total points
ID: 1325458
Derive from CTreeCtrl - class wiz can generate a skeleton class for you.

add a init function take the directory to start from

Use FindFirstFile/FindNextFile to scan for file/directory names) - don't forget this will spot the directory entries "." and ".." in directories (the current directory and the link to the one above) - and you may not want to show these.

When you add responses to tree control notifications (e.g. you might only scan directory names when the user expands a brank) use the reflected notifications (the ones with = before them in the class wiz - see TN062).

That's it.

To use simply place a tree control on a dialog or whatever, and instead of link a CTreeCtrl member variable, add a CDerivedTreeCtrl (or whatever name you gave it), and init it (e.g. during OnInitDialog).
0
 

Author Comment

by:brosoft
ID: 1325459
Thanks, already got it figured out... :)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 121
Error on moodle after upgrade 3 130
zeroMAx challenge 20 100
ASP.NET C# MessageBox.Show Showing a modal dialog box or form when the application ... 2 120
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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