⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mysocket.cpp

📁 给出了在Winsock的支持下用Visual C++制作聊天室的过程,不必关心系统内部复杂的机制.
💻 CPP
字号:
// Mysocket.cpp : implementation file
//

#include "stdafx.h"
#include "Client.h"
#include "Mysocket.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMysocket

CMysocket::CMysocket(CClientDlg* pDlg)
{
	pClientdlg = pDlg;
}

CMysocket::~CMysocket()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CMysocket member functions

void CMysocket::OnReceive(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if (pClientdlg)
	{
		pClientdlg->ReceiveData();//调用主对话框的ReceiveData方法接收数据
	}
	CSocket::OnReceive(nErrorCode);
}

void CMysocket::OnClose(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if (pClientdlg)
	{
		pClientdlg->closesocket();
	}
	CSocket::OnClose(nErrorCode);
}

⌨️ 快捷键说明

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