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?