⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chatserverdoc.h

📁 chatserver源码
💻 H
字号:
// ChatServerDoc.h : interface of the CChatServerDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_CHATSERVERDOC_H__4E777F0A_D2FD_11D4_AF14_00E04CDD4565__INCLUDED_)
#define AFX_CHATSERVERDOC_H__4E777F0A_D2FD_11D4_AF14_00E04CDD4565__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ListenSocket.h"//添加的代码
#include "ClientSocket.h"//添加的代码

class CMsg;//添加的代码

class CChatServerDoc : public CDocument
{
protected: // create from serialization only
	CChatServerDoc();
	DECLARE_DYNCREATE(CChatServerDoc)

// Attributes
public:
	CListenSocket* m_pSocket;
	CStringList m_msgList;
	CPtrList m_connectionList;
// Operations
public:        //以下为自己定义的函数
	void UpdateClients();
	void ProcessPendingAccept();
	void ProcessPendingRead(CClientSocket* pSocket);
	CMsg* AssembleMsg(CClientSocket* pSocket);
	CMsg* ReadMsg(CClientSocket* pSocket);
	void SendMsg(CClientSocket* pSocket, CMsg* pMsg);
	void CloseSocket(CClientSocket* pSocket);
	void Message(LPCTSTR lpszMessage);

// 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)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	afx_msg void OnUpdateMessages(CCmdUI* pCmdUI);
	afx_msg void OnUpdateConnections(CCmdUI* pCmdUI);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHATSERVERDOC_H__4E777F0A_D2FD_11D4_AF14_00E04CDD4565__INCLUDED_)

⌨️ 快捷键说明

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