龙山招聘网最新招聘:这是一段mfc聊天程序的代码,具体为向一个listbox内添加在线人员的代码,请给解释下,谢谢了

来源:百度文库 编辑:高校问答 时间:2024/05/14 09:24:04
BOOL CCleanDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_cleanname="";
m_cleanlist.ResetContent();
CMainFrame* frame=(CMainFrame*)AfxGetMainWnd();
CChatServerDoc* doc=(CChatServerDoc* )(frame->GetActiveView()->GetDocument());
for(POSITION pos=doc->m_connectionList.GetHeadPosition();pos;)
{ CClientSocket* sock=(CClientSocket*)(doc->m_connectionList.GetNext(pos));
m_cleanlist.AddString(sock->name);
}
}