Solved

TreeView as ActiveX Control in C++

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

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

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

20 Experts available now in Live!

Get 1:1 Help Now