mysocket.cpp
来自「比较不错的网络开发源码VC版,是铁道出版社出版的图书源码」· C++ 代码 · 共 65 行
CPP
65 行
// MySocket.cpp: implementation of the CMySocket class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Talk.h"
#include "MySocket.h"
#include "TalkDlg.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMySocket::CMySocket()
{
//put the member pointer to NULL
m_pDlg=NULL;
}
CMySocket::~CMySocket()
{
//put the member pointer to NULL
m_pDlg=NULL;
}
void CMySocket::SetParent(CTalkDlg* pDlg)
{
//set the member pointer
m_pDlg=pDlg;
}
void CMySocket::OnAccept(int nErrorCode)
{
if (nErrorCode==0)
//call the dialog's OnAccept function
m_pDlg->OnAccept();
}
void CMySocket::OnConnect(int nErrorCode)
{
if (nErrorCode==0)
//call the dialog's OnConnect function
m_pDlg->OnConnect();
}
void CMySocket::OnReceive(int nErrorCode)
{
if (nErrorCode==0)
//call the dialog's OnReceive function
m_pDlg->OnReceive();
}
void CMySocket::OnClose(int nErrorCode)
{
if (nErrorCode==0)
//call the dialog's OnClose function
m_pDlg->OnClose();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?