Solved

TreeView as ActiveX Control in C++

Posted on 1998-12-22
2
328 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 100 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

706 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

15 Experts available now in Live!

Get 1:1 Help Now