mysocket.cpp

来自「EVC4.0入门程序 关于TCP测试使用工具」· C++ 代码 · 共 81 行

CPP
81
字号
// MySocket.cpp : implementation file
//

#include "stdafx.h"
#include "Step3_tcptest.h"
#include "MySocket.h"
#include "Step3_tcptestDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMySocket

CMySocket::CMySocket()
{
}

CMySocket::~CMySocket()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CMySocket member functions

void CMySocket::SetParent(CStep3_tcptestDlg *pDlg)
{
	m_pDlg = pDlg;
}


void CMySocket::OnAccept(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	CCeSocket::Accept(

	if( nErrorCode==0 )
		m_pDlg->OnAccept( );
	
	CCeSocket::OnAccept(nErrorCode);
}

void CMySocket::OnClose(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if( nErrorCode==0 )
		m_pDlg->OnClose( );

	CCeSocket::OnClose(nErrorCode);
}

void CMySocket::OnConnect(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if( nErrorCode==0 )
		m_pDlg->OnConnect( );
	
	CCeSocket::OnConnect(nErrorCode);
}

void CMySocket::OnReceive(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	if( nErrorCode==0 )
		m_pDlg->OnReceive();
	
	//CCeSocket::OnReceive(nErrorCode);
}

⌨️ 快捷键说明

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