void CAT_ChatViewDlg:: OnCbnSelchangeChannel() { m_listMst.ResetContent(); switch(m_pComboBox.GetCurSel()) { case 0: { for (int i= 0; i<m_pMapList->count;i++) { char *pStr = (char*)m_pMapList->Items[i]; m_listMsg.AddString(pStr); } } breal; } LRESULT CAT_ChatViewDlg::OnRecvPacket(WPARAM wParam,LPARAM lparam) { Packet* pPacket = (Packet*)wParam; int nIndex = (int)lParam; SET_DATA(pMsgPacket,ACCOUNT,GAME_CHATMSG,pPacket); if(nIndex>=m_pListServers->Count) return 0 ; CGameServer* pServer =(CGameServer*)m_pListServers->Items[nIndex]; ^^ switch(pMsgPacket->dwChannel) { case 0; //ditu { char * pStr = strdup(strTmp.GetBuffer()); m_pMapList ->Add(pStr); if(m_pMapList->Count>1000) { char * pchar = (char*) m_pMapList->Delete(0); free(pchar); } strTmp.ReleaseBuffer(); break; }