HTREEITEM CNetWordClientDlg::GetChatUser(CString userName)
{
HTREEITEM hRoot=this->m_ctlUserTree.GetRootItem();
    MessageBox("OK");
if(hRoot!=NULL)
{
 hRoot=this->m_ctlUserTree.GetChildItem(hRoot);
 while(hRoot!=NULL)
 {
            hRoot=this->m_ctlUserTree.GetNextSiblingItem(hRoot);
CString str=this->m_ctlUserTree.GetItemText(hRoot);
if(str==userName)
{
return hRoot;
}
 }
} return NULL;
}void CNetWordClientDlg::UpdateTreeItem(CString hItem,const int iNormalIcon,const int iSelectedIcon)
{
MessageBox("3");
HTREEITEM hRoot=GetChatUser(hItem);
ASSERT(hRoot!=NULL);
    this->m_ctlUserTree.SetItemImage(hRoot,iNormalIcon,iSelectedIcon);
}void CNetWordClientDlg::OnTimer(UINT nIDEvent) 
{
// TODO: Add your message handler code here and/or call default ASSERT(m_msgList.GetCount()!=0);
POSITION pos=NULL;
CUserInfo *pInfo=NULL;
    for(pos=this->m_msgList.GetHeadPosition();pos!=NULL;)
{
pInfo=(CUserInfo*)m_msgList.GetNext(pos);
        if(nIDEvent=pInfo->GetTimerID())
{
int i=pInfo->AddTimer();
i%=2;
if(i==1)
{
//taskItem.hIcon=AfxGetApp()->LoadIcon(IDI_ICON3);
// ::Shell_NotifyIcon(NIM_MODIFY,&taskItem);
MessageBox("1");
ASSERT(!pInfo->m_userName.IsEmpty());
UpdateTreeItem(pInfo->m_userName,1,0);
}else
{
// taskItem.hIcon=AfxGetApp()->LoadIcon(IDI_ICON3);
//::Shell_NotifyIcon(NIM_MODIFY,&taskItem);
MessageBox("2");
ASSERT(!pInfo->m_userName.IsEmpty());
UpdateTreeItem(pInfo->m_userName,0,1);
}
}
}
CDialog::OnTimer(nIDEvent);
}程序确实输出了2/1意思进入了onTimer可是怎么没进入UpdateTreeItem,不知道什么原因??本来打了短点,可是不知道怎么程序在加载还能调试,最后不能调试了?不知道怎么起的??谢谢回复!!!