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

📄 chatclientdoc.h

📁 基于winsock的聊天程序
💻 H
字号:
// ChatClientDoc.h : interface of the CChatClientDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_CHATCLIENTDOC_H__332390BE_F0A7_4BBC_985A_17F128471B2E__INCLUDED_)
#define AFX_CHATCLIENTDOC_H__332390BE_F0A7_4BBC_985A_17F128471B2E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Msg.h"
class CClientSocket;

class CChatClientDoc : public CRichEditDoc
{
protected: // create from serialization only
	CChatClientDoc();
	DECLARE_DYNCREATE(CChatClientDoc)

// Attributes
public:
	CMsg msg;
	int m_number;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChatClientDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL
	virtual CRichEditCntrItem* CreateClientItem(REOBJECT* preo) const;

// Implementation
public:
	void UpdateConnects();
	void Disconnect();
	BOOL m_bFilter;
	void ReceiveMsg();
	void SendMsg();
	BOOL ConnectSocket(LPCTSTR lpszHandle, LPCTSTR lpszAddress, LPCTSTR m_strImage, UINT nPort);
	void ProcessPendingRead();
	BOOL m_bConnected;
	virtual ~CChatClientDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	CClientSocket* m_pSocket;
	CSocketFile* m_pFile;
	CArchive* m_pArchiveIn;
	CArchive* m_pArchiveOut;

	CString  m_strHandle;
	void talk(int type, CString from, CString to, CString str,COLORREF clr);
	void DisplayRecMsg(int type, CString from, CString to,BOOL sec, CString str, COLORREF clr);
	void DisplayMsg(LPCTSTR lpszText);
// Generated message map functions
protected:
	//{{AFX_MSG(CChatClientDoc)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_CHATCLIENTDOC_H__332390BE_F0A7_4BBC_985A_17F128471B2E__INCLUDED_)

⌨️ 快捷键说明

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