?
Solved

TreeView as ActiveX Control in C++

Posted on 1998-12-22
2
Medium Priority
?
339 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
[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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

777 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