现在的位置: 首页 > 综合 > 正文

聊天分频道获取,m_pComboBox的应用

2013年09月07日 ⁄ 综合 ⁄ 共 705字 ⁄ 字号 评论关闭
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;

}

 

抱歉!评论已关闭.