freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

vc設計簡單的聊天室設計畢業(yè)設計(doc畢業(yè)設計論文)(編輯修改稿)

2025-07-23 20:19 本頁面
 

【文章內(nèi)容簡介】 ocket。 pNewClientInitialize(this)。 (*pNewClient)。 // 放入鏈表中 (pNewClient)。}void CServerDlg::OnClientClose(WPARAM wParam, LPARAM lParam){ CMySocket *p_delClient = (CMySocket*)wParam。 // 關閉該用戶 p_delClientShutDown()。 char buffer[BUFFERSIZE]。 while(p_delClientReceive(buffer, BUFFERSIZE)0)。 p_delClientClose()。 // 在用戶鏈表中刪除該用戶 POSITION psCur, psList = ()。 CMySocket *p_curClient。 while(psList!=NULL) { psCur = psList。 p_curClient = (CMySocket *)(psList)。 if(p_delClient==p_curClient) { (psCur)。 break。 } } // 發(fā)送信息告訴其他用戶該客戶退出 CString strMsg。 (IDS_CLIENT_CLOSE)。 NETMESSAGE netMessage(PTC_CLIENT_QUIT, p_delClientGetName(), _T(), p_delClientGetName() + strMsg)。 SendToAllClient(netMessage)。 // 界面上清理該用戶信息 ((1, p_delClientGetName()))。 ShowInDisplay(p_delClientGetName() + strMsg)。 // 刪除該用戶 delete p_delClient。}void CServerDlg::OnReceive(WPARAM wParam, LPARAM lParam){ CMySocket *p_curClient = (CMySocket*)wParam。 NETMESSAGE netMessage。 p_curClientReceive((char *)amp。netMessage, sizeof(netMessage))。 switch() { case PTC_NEW: // 新客戶加入 NewClientAdd(p_curClient, amp。netMessage)。 break。 case PTC_SAY: // 普通聊天 ShowMessage(netMessage)。 break。 } // 把加工過的信息發(fā)送給其他用戶 SendToAllClient(netMessage)。}void CServerDlg::CloseServer(){ if(!m_bServer) return。 // 向所有客戶發(fā)送服務端關閉的信息 CString strInfo。 (IDS_CLOSESERVER)。 NETMESSAGE netMessage(PTC_SYSTEM, _T(), _T(), strInfo)。 SendToAllClient(netMessage)。 // 服務端界面顯示關閉信息 ShowInDisplay(strInfo)。 // 關閉服務端 ()。 // 關閉客戶端 char buffer[BUFFERSIZE]。 CMySocket *m_pClient。 POSITION psList = ()。 while(psList!=NULL) { m_pClient = (CMySocket *)(psList)。 m_pClientShutDown()。 while(m_pClientReceive(buffer, BUFFERSIZE)0)。 m_pClientClose()。 delete m_pClient。 } ()。 m_bServer = FALSE。}// 向所有戶發(fā)出信息void CServerDlg::SendToAllClient(const NETMESSAGE amp。netMessage){ CMySocket *m_pClient。 POSITION psList = ()。 while(psList!=NULL) { m_pClient = (CMySocket *)(psList)。 m_pClientSendMsg(netMessage)。 }}void CServerDlg::ShowInDisplay(CString str){ m_strDisplay += str + \r\n。 UpdateData(false)。}void CServerDlg::OnDestroy() { CDialog::OnDestroy()。 // TODO: Add your message handler code here}// 新用戶加入 void CServerDlg::NewClientAdd(CMySocket *p_client, NETMESSAGE *netMessage){ // 存入用戶名字 p_clientSetName(netMessageform)。 // 在列表框中顯示該用戶 (p_clientGetName())。 // 發(fā)送用戶列表給該客戶 NETMESSAGE netMsg(PTC_USER_LIST, _T(), _T(), _T())。 int iListLen = ()。 CString strMsg。 for(int index=()。 indexiListLen。 index++) { (index, strMsg)。 strcpy(, (LPCTSTR)strMsg)。 p_clientSendMsg(netMsg)。 } // 加工信息 (IDS_NEW_CLIENT)。 strMsg = p_clientGetName() + strMsg。 strcpy(netMessagedata, (LPCTSTR)strMsg)。 // 顯示該用戶進入 ShowInDisplay(strMsg)。}// 顯示普通消息void CServerDlg::ShowMessage(NETMESSAGE netMessage){ CString strTo = 。 if(strTo==_T()) { strTo = 所有人。 } CString strForm = 。 CString strMsg = 。 CString strOut = strForm + 對 + strTo + 說: + strMsg。 ShowInDisplay(strOut)。}客戶端:// : implementation fileinclude include include ifdef _DEBUGdefine new DEBUG_NEWundef THIS_FILEstatic char THIS_FILE[ ] = __FILE__。endif/////////////////////////////////////////////////////////////////////////////// CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialog{public: CAboutDlg()。 enum { IDD = IDD_ABOUTBOX }。 protected: virtual void DoDataExchange(CDataExchange* pDX)。 // DDX/DDV supportprotected: DECLARE_MESSAGE_MAP()}。CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD){}void CAboutDlg::DoDataExchange(CDataExchange* pDX){ CDialog::DoDataExchange(pDX)。}BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)END_MESSAGE_MAP() // CClientDlg dialogCClientDlg::CClientDlg(CWnd* p
點擊復制文檔內(nèi)容
試題試卷相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1