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

📄 lxsocket.cpp

📁 实现网络图象传输
💻 CPP
字号:
// LxSocket.cpp : implementation file
//

#include "stdafx.h"
#include "lxdraw.h"
#include "LxSocket.h"
#include "LxDrawDoc.h"

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

/////////////////////////////////////////////////////////////////////////////
// CLxSocket

CLxSocket::CLxSocket()
{
}

CLxSocket::~CLxSocket()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CLxSocket member functions

void CLxSocket::SetParent(CDocument *pDoc)
{
	m_pDoc=pDoc; //把创建CMySocket的文档类对象指针存放在m_pDoc中。

}

void CLxSocket::OnAccept(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(nErrorCode==0)
		((CLxdrawDoc*)m_pDoc)->OnAccept();//调用CDocument父类的同名函数

}

void CLxSocket::OnClose(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(nErrorCode==0)
		((CLxdrawDoc*)m_pDoc)->OnClose();//调用CDocument父类的同名函数

}

void CLxSocket::OnReceive(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(nErrorCode==0)
		((CLxdrawDoc*)m_pDoc)->OnReceive();//调用CDocument父类的同名函数

}

void CLxSocket::OnSend(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(nErrorCode==0)
		((CLxdrawDoc*)m_pDoc)->OnSend();//调用CDocument父类的同名函数

}

void CLxSocket::OnConnect(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	CAsyncSocket::OnConnect(nErrorCode);
}

⌨️ 快捷键说明

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