chatsocket.cpp

来自「网络聊天用VC编写的」· C++ 代码 · 共 50 行

CPP
50
字号
// ChatSocket.cpp : implementation file
//

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

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

/////////////////////////////////////////////////////////////////////////////
// CChatSocket

CChatSocket::CChatSocket()
{
}
CChatSocket::CChatSocket(CChatClientDlg* pDlg)
{
	m_pDlg = pDlg;
}
CChatSocket::~CChatSocket()
{
}


// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CChatSocket, CSocket)
	//{{AFX_MSG_MAP(CChatSocket)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif	// 0

/////////////////////////////////////////////////////////////////////////////
// CChatSocket member functions

//通知客户端可以结束数据了
void CChatSocket::OnReceive(int nErrorCode) 
{
	CSocket::OnReceive(nErrorCode);

	//让主对话框处理数据
	if(m_pDlg)
		m_pDlg->ProcessPendingRead();
}

⌨️ 快捷键说明

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