int CZiMainFrame::OnSelectSearch(TNotifyUI & msg) { CEditUI * pSearchEdit = DuiControl(CEditUI, _T("SearchEdit")); CComboUI * pSearchCombo = DuiControl(CComboUI, _T("SearchCombo")); LPCTSTR ptsSearchName = pSearchEdit->GetText().GetData(); Assert(pSearchEdit && pSearchCombo); Assert(ptsSearchName); int nIndex = pSearchCombo->GetCurSel(); if(nIndex < 0) return 0; CListLabelElementUI * pItem = static_cast<CListLabelElementUI*>( pSearchCombo->GetItemAt(nIndex)); Assert(pItem); Assert(nIndex < (int)m_searchNodes.size()); pSearchEdit->SetText(pItem->GetText()); CreateChatDailog(m_searchNodes[nIndex]); return 0; }