注册 登录
编程论坛 VC++/MFC

请问如下程序中 text的数值从何而来

zanguozanguo 发布于 2016-06-03 17:45, 3395 次点击
void CEx06bDialog::OnSelchangedTreeview1(NMHDR* pNMHDR, LRESULT* pResult)
{
    NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    CTreeCtrl* pTree = (CTreeCtrl*) GetDlgItem(IDC_TREEVIEW1);
    HTREEITEM hSelected = pNMTreeView->itemNew.hItem;
    if (hSelected != NULL) {
        char text[31];
        TV_ITEM item;
        item.mask = TVIF_HANDLE | TVIF_TEXT;
        item.hItem = hSelected;
      item.pszText = text;
  // text    =    item.pszText ;
        item.cchTextMax = 30;
        VERIFY(pTree->GetItem(&item));
        SetDlgItemText(IDC_STATIC_TREEVIEW1, text);
    }
   
    *pResult = 0;
}
没有看到哪个地方给text赋值呀
1 回复
#2
rjsp2016-06-06 16:04
pTree->GetItem(&item)
1