|
-
May 16th, 1999, 09:12 AM
#1
CTreeCtrl
Hi,
I insert objects address as lParam in CTreeList and when I try to get it at OnDblclk.
by this code
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
TVITEMA* pItemNew = &pNMTreeView->itemNew;
CCityOb* pCity = (CCityOb*) pItemNew->lParam;
pCity don't return as vaild object, any one can help me
thanks.
-
May 29th, 1999, 06:10 PM
#2
Re: CTreeCtrl
I had the same problem.
This is a little tricky but works:
OnItemDoubleClick()
{
HTREEITEM item;
item = m_Tree.GetSelectedItem();
//...
}
This way you can know the item by text using
CString ItemText = m_Tree.GetItemText(item)
but i don't remember if the HTREEITEM structure allows you to get the index.
Hope it helps.
-
May 30th, 1999, 02:46 AM
#3
Re: CTreeCtrl
how do you poke the data in there?
-
May 30th, 1999, 11:21 PM
#4
Re: CTreeCtrl
When inserting the item in the control use this
CCityOb* pCity = new CCityOb;
//call any methods or initialize CCityOb
//and then
...->lParam = pCity;
where lParam is from the item u r inserting.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|