-
February 14th, 2012, 11:38 AM
#1
How get string value of HTREEITEM?
How get string value of HTREEITEM?
-
February 14th, 2012, 11:49 AM
#2
Re: How get string value of HTREEITEM?
Have you checked the documentation? There's a method with a really obvious name.
-
February 14th, 2012, 11:54 AM
#3
Re: How get string value of HTREEITEM?
GCDEF,
I had found GetItemText, but it range "Identifier not found".
-
February 14th, 2012, 11:54 AM
#4
Re: How get string value of HTREEITEM?
Originally Posted by AKE
GCDEF,
I had found GetItemText, but it range "Identifier not found".
Then I guess you're not using it correctly.
-
February 14th, 2012, 12:00 PM
#5
Re: How get string value of HTREEITEM?
I must call it in CTreeView method...
I tried such
this->GetItemText(hItem)
GetItemText(hItem)
(descendant):
CDirView->GetItemText(hItem)
((CTreeView *) this)-> GetItemText(hItem)
-
February 14th, 2012, 12:07 PM
#6
Re: How get string value of HTREEITEM?
Originally Posted by AKE
I must call it in CTreeView method...
I tried such
this->GetItemText(hItem)
GetItemText(hItem)
(descendant):
CDirView->GetItemText(hItem)
((CTreeView *) this)-> GetItemText(hItem)
That one should work if you're calling it from your CTreeView derived class. Which class are you calling it from?
-
February 14th, 2012, 12:14 PM
#7
Re: How get string value of HTREEITEM?
class CDirView: public CTreeView
...
void CDirView::OnItemExpanding1(NMHDR *pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW *pNMTreeView = (NM_TREEVIEW *) pNMHDR;
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
wchar_t *temp = GetItemText(hItem);
}
-
February 14th, 2012, 12:38 PM
#8
Re: How get string value of HTREEITEM?
And what's the exact problem? Compile or runtime error?
-
February 14th, 2012, 12:43 PM
#9
Re: How get string value of HTREEITEM?
GCDEF
Compile error C3861: Identifier not found
-
February 14th, 2012, 01:00 PM
#10
Re: How get string value of HTREEITEM?
Originally Posted by AKE
class CDirView: public CTreeView
...
void CDirView::OnItemExpanding1(NMHDR *pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW *pNMTreeView = (NM_TREEVIEW *) pNMHDR;
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
wchar_t *temp = GetItemText(hItem);
}
it should be
Code:
CString text = GetTreeCtrl().GetItemText(hItem);
Victor Nijegorodov
-
February 14th, 2012, 01:17 PM
#11
Re: How get string value of HTREEITEM?
-
February 14th, 2012, 01:18 PM
#12
Re: How get string value of HTREEITEM?
-
February 14th, 2012, 01:41 PM
#13
Re: How get string value of HTREEITEM?
GCDEF, Sorry. You of couse help me too. Thanks.
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
|