www.pudn.com > 3.rar > ChatSocket.cpp


// ChatSocket.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "ChatClient.h" 
#include "ChatSocket.h" 
#include "ChatClientDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CChatSocket 
IMPLEMENT_DYNAMIC(CChatSocket, CSocket) 
CChatSocket::CChatSocket() 
{ 
} 
 
CChatSocket::~CChatSocket() 
{ 
} 
 
 
// Do not edit the following lines, which are needed by ClassWizard. 
#if 0 
BEGIN_MESSAGE_MAP(CChatSocket, CSocket) 
	//{{AFX_MSG_MAP(CChatSocket) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
#endif	// 0 
 
///////////////////////////////////////////////////////////////////////////// 
// CChatSocket member functions 
CChatSocket::CChatSocket(CChatClientDoc* pDoc) 
{ 
	m_pDoc = pDoc; 
} 
 
void CChatSocket::OnReceive(int nErrorCode) 
{ 
	//调用CSocket的OnReceive函数 
	CSocket::OnReceive(nErrorCode); 
	//其余工作交给文档类处理 
	m_pDoc->ProcessReceive(); 
}