cltsocket.cpp

来自「VC++高级编程技巧与示例」· C++ 代码 · 共 48 行

CPP
48
字号
// CltSocket.cpp : implementation file
//

#include "stdafx.h"
#include "WBC.h"
#include "CltSocket.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCltSocket

CCltSocket::CCltSocket()
{
	m_Info=new char[255];
	memset(m_Info,0,255);
}

CCltSocket::~CCltSocket()
{
	delete m_Info;
}


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

/////////////////////////////////////////////////////////////////////////////
// CCltSocket member functions

void CCltSocket::OnReceive(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	memset(m_Info,0,255);
	ReceiveFrom((void *)m_Info,255,SrvrAdd,m_Port);
	::PostMessage(AfxGetApp()->m_pMainWnd->m_hWnd,CLT_RECEIVE,0,0);
	CSocket::OnReceive(nErrorCode);
}

⌨️ 快捷键说明

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