Thread: CTree
View Single Post
Old 11-26-2007, 09:37 AM   #1 (permalink)
complete
Code Monkey
 
complete's Avatar
 
Join Date: Jul 2005
Location: St. Louis
Posts: 76
complete is on a distinguished road
CTree

I had thought that using a CTree control was pretty easy and straight-forward.

For the root of the CTree control, I use the insertItem method:

HTML Code:
//(where m_strRoot is a CString type)
m_hParent = m_ctrlTree.InsertItem(m_strRoot , TVI_ROOT);
And that works fine.

When I try to insert child noted into the tree, that is when I have a problem. It does not work. I use the handle I got when I inserted the root node and
TVI_LAST:

Code:
HTREEITEM hChild = m_ctrlTree.InsertItem(m_strChild, m_hParent,TVI_LAST);
Does anyone have any experience working with the MFC CTree control?
__________________
46 45 52 4D 49 20 57 41 53 20 4A 45 44 49 2E 10
20 53 41 47 41 4E 20 57 41 53 20 53 49 54 48 2E
complete is offline   Reply With Quote