我用这样的方式添加Treeview的item:TV_INSERTSTRUCT tvstruct;
tvstruct.hParent = NULL;
tvstruct.hInsertAfter = TVI_FIRST;
tvstruct.item.iImage = 0;
tvstruct.item.iSelectedImage = 0;
tvstruct.item.pszText = _T("Hello,world");
tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
refCtrl.InsertItem(&tvstruct);然后在
void CLeftView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult) 
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
         CTreeCtrl& refCtrl = GetTreeCtrl();
AfxMessageBox(pNMTreeView->itemNew.pszText);}
如果我选择那个节点,期待出现的msgbox里面是"Hello,world" 可是现在却出现乱码,无论那个 pszText 设置成其他什么(包括中文)都是那两个乱码。到底怎样才能得到当前选定的节点的文本?