Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Building Tree Ctrl into Dialog

Posted on 1998-09-17
2
Medium Priority
?
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
girts063098 earned 520 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

688 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