主题:tree控件的问题
void CTreeDlg::AddtoTree(HTREEITEM m_node,int UpperId)
{
int i;
HTREEITEM m_child;
for(i=0;i<dep.a_UpperId.GetSize(); i++)
{
if (UpperId == dep.a_UpperId.GetAt(i))
{
m_child = m_tree.InsertItem(dep.a_DepName.GetAt(i), m_node);
m_tree.SetItemData(m_child, atoi(dep.a_DepId.GetAt(i)));
AddtoTree(m_child, atoi(dep.a_DepId.GetAt(i)));
}
}
}
编辑没错;但是只有根结点显示;其他节点没有写入AddtoTree没反应
{
int i;
HTREEITEM m_child;
for(i=0;i<dep.a_UpperId.GetSize(); i++)
{
if (UpperId == dep.a_UpperId.GetAt(i))
{
m_child = m_tree.InsertItem(dep.a_DepName.GetAt(i), m_node);
m_tree.SetItemData(m_child, atoi(dep.a_DepId.GetAt(i)));
AddtoTree(m_child, atoi(dep.a_DepId.GetAt(i)));
}
}
}
编辑没错;但是只有根结点显示;其他节点没有写入AddtoTree没反应