📄 mysock.cpp
字号:
// MySock.cpp : implementation file
//
#include "stdafx.h"
#include "WinSock.h"
#include "MySock.h"
#include "WinSockDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMySock
CMySock::CMySock()
{
}
CMySock::~CMySock()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CMySock, CAsyncSocket)
//{{AFX_MSG_MAP(CMySock)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
/////////////////////////////////////////////////////////////////////////////
// CMySock member functions
void CMySock::SetParent(CDialog *pWnd)
{
m_pWnd = pWnd;
}
void CMySock::OnAccept(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
if(nErrorCode == 0)
((CWinSockDlg*)m_pWnd)->OnAccept();
CAsyncSocket::OnAccept(nErrorCode);
}
void CMySock::OnClose(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
if(nErrorCode == 0)
((CWinSockDlg*)m_pWnd)->OnClose();
CAsyncSocket::OnClose(nErrorCode);
}
void CMySock::OnConnect(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
if(nErrorCode == 0)
((CWinSockDlg*)m_pWnd)->OnConnect();
CAsyncSocket::OnConnect(nErrorCode);
}
void CMySock::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
if(nErrorCode == 0)
((CWinSockDlg*)m_pWnd)->OnReceive();
CAsyncSocket::OnReceive(nErrorCode);
}
void CMySock::OnSend(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
if(nErrorCode == 0)
((CWinSockDlg*)m_pWnd)->OnSend();
CAsyncSocket::OnSend(nErrorCode);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -