chatserverdoc.h
来自「chatserver源码」· C头文件 代码 · 共 75 行
H
75 行
// 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 + =
减小字号Ctrl + -
显示快捷键?