Solved

Building Tree Ctrl into Dialog

Posted on 1998-09-17
2
285 Views
Last Modified: 2013-11-20
Help ! I'm trying to build a tree control into a dialog. I can create such a control by "drawing" it in the dialog box then assigning a member variable to it and manipulating it using the dialog class and using the member variable to fill the tree with data - so far no problem !

But my app needs to be able to read a file containing tree structure data when it opens, the user can modify that data, then the updated data is saved on exit.

The problem is that in order to save the data I need access to the Serialise function of the control. I think this means that I need to create a separate new class based on CTreeCtrl. However, within that new class I cannot find a way of connecting it to the control which I have created in my dialog box, and no way of mapping its members.

Please can someone tell me how I can make "child" control classes such as CTreeCtrl work with a "parent" dialog class so that the dialog class is linking with the control class, and where I should be adding data to my control - within the Dialog class or the CTreeCtrl class. How are you supposed to implement these control classes?

Sorry if the question is a messy one  - ask for more details or tell me if I'm being an idiot !

Thank you,
Boedeker
0
Comment
Question by:boedeker
2 Comments
 
LVL 1

Accepted Solution

by:
girts063098 earned 130 total points
ID: 1322241
As I understood you want to create new class such as CMyTreeCtrl with new(your own) methods like LoadDataFromFile(). To do it you have to:
(you have already "drew" tree control in dialog box)
1.Create new class CMyTreeCtrl with CTreeCtrl as base class.
2.When assigning a member variable to it choose type - CMyTreeCtrl.
Now CMyTreeCtrl is the base class of tree control you "drew".
Now you can add your own methods to CMyTreeCtrl or override existing ones.

Girts.
0
 

Author Comment

by:boedeker
ID: 1322242
Thanks a lot Girt - I just needed to know how to map the member variable to my "child" class, so your answer is perfect !

Boedeker
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now