www.pudn.com > 3.rar > ChatServerDoc.h


// ChatServerDoc.h : interface of the CChatServerDoc class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_CHATSERVERDOC_H__314F867D_7BC7_4430_9843_F3D7C10E81C8__INCLUDED_) 
#define AFX_CHATSERVERDOC_H__314F867D_7BC7_4430_9843_F3D7C10E81C8__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
class CListeningSocket; 
class CClientSocket; 
class CMsg; 
 
class CChatServerDoc : public CDocument 
{ 
protected: // create from serialization only 
	CChatServerDoc(); 
	DECLARE_DYNCREATE(CChatServerDoc) 
 
// Attributes 
public: 
	CListeningSocket* m_pSocket; 
	CStringList       m_msgList; 
	CPtrList          m_connectionList; 
	BOOL 	          bIsNewChatter; 
	CString           m_ChattersList; 
// Operations 
public: 
	void SendToAllClients(int nCode); 
	void ProcessAccept(); 
	void ProcessReceive(CClientSocket* pSocket); 
	CMsg* AssembleMsg(CClientSocket* pSocket , int nCode); 
	CMsg* ReadMsg(CClientSocket* pSocket); 
	void SendMsg(CClientSocket* pSocket, CMsg* pMsg); 
	void CloseSocket(CClientSocket* pSocket); 
	void UpdateMessageView(LPCTSTR lpszMessage); 
	BOOL IsUsedName(CString sNickName); 
	void SendForNewcomer(CMsg* pMsg); 
	void DeleteChatter(CMsg* pMsg); 
	void UpdateChattersListView(CString sName , CClientSocket* pSocket); 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CChatServerDoc) 
	public: 
	virtual BOOL OnNewDocument(); 
	virtual void Serialize(CArchive& ar); 
	virtual void DeleteContents(); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CChatServerDoc(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CChatServerDoc) 
	afx_msg void OnSetport(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_CHATSERVERDOC_H__314F867D_7BC7_4430_9843_F3D7C10E81C8__INCLUDED_)