[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

TreeView as ActiveX Control in C++

Posted on 1998-12-22
2
Medium Priority
?
346 Views
Last Modified: 2008-03-06
If I try to add the Microsoft TreeView control into a C++ project using the Component Gallery, several different wrapper files are generated even though it's only one component.  I'm used to using CreateControl() with one wrapper file, but what do I do with several?  How do they communicate with each other?  If you use this control in Visual Basic it's easy, you just say treecontrol.node.add() or treecontrol.treeview.refresh().  If I were using the windows message version of the TreeView, I could send it a WM_NOTIFY message with EXPAND so make the tree automatically expand.  How would I perform this same function when I'm treating it as an ActiveX control?  Is there any documenation out there on this or similar?
0
Comment
Question by:MarkDBaker
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 300 total points
ID: 1180917
Yes, they are releated to each other. If you look at treeview.h, you'll see that the TreeView class has a lot of member functions. Some of these member functions return non-intrinsic types and hence the need for other classes. In general, all of the member functions you are used to in VB are available in VC++. Some of the names have been changed to accommodate that language features. For example, treecontrol.node does not exist in C++. Instead, you will need to use GetNodes() to retrieve a nodes object. But other than that, everything else is there and just about the same.
0
 

Author Comment

by:MarkDBaker
ID: 1180918
I was staring to glean that, but couldn't find any documentation to confirm.  I guess Class Wizard understands the need to get at the different interfaces, so it generates functions such as GetNodes() in the wrapper class to help you out.  I originally thought GetNodes() was part of the TreeView control itself.  In order to understand what all the different methods are, do I just sort of try and guess and match up with the Visual Basic documenation as best I can?  Also, would I be correct in guessing that to make the treeview expand I should make a call to get the hWnd and then send a message to the hwnd?


0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

872 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