Solved

TreeView as ActiveX Control in C++

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

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

732 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