Click to See Complete Forum and Search --> : CTreeView?


skippy
April 13th, 1999, 01:51 AM
Just wondering if anyone understands how CTreeView is actually implemented. When you look at the source code, the GetTreeCtrl() function just returns a pointer to itself (CTreeView). If you follow the inheritance chain, you will find that no-where does it inherit from CTreeCtrl. Can anyone shed any light?

thanks

SKB
April 13th, 1999, 11:33 AM
CTreeView::GetTreeCtrl() returns a reference to a CTreeCtrl and not a CTreeView.
The CTreeCtrl is the wrapper that sets onto of the API TreeCtrl.

So you can access the TreeCtrl and add an Item like so
CTreeCtrl &Tree = CTreeView::GetTreeCtrl();
Tree.InsertItem("New Item added");