lxsocket.cpp

来自「实现网络图象传输」· C++ 代码 · 共 82 行

CPP
82
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?