chatsocket.cpp

来自「网络聊天程序客户端」· C++ 代码 · 共 35 行

CPP
35
字号
// ChatSocket.cpp: implementation of the CChatSocket class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ChatClient.h"
#include "ChatSocket.h"
#include "ClientDlg.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_DYNAMIC(CChatSocket,CSocket)

//构造函数
CChatSocket::CChatSocket(CClientDlg* pDlg)
{
	//成员变量赋值
	m_pDlg=pDlg;
}

//事件处理函数
void CChatSocket::OnReceive(int nErrorCode)
{
	CSocket::OnReceive(nErrorCode);
	//调用CClientDlg类的相应函数处理
	m_pDlg->OnReceive();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?