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

📄 clientdlg.h

📁 一个小型的网络聊天服务器和客户端
💻 H
字号:
// ClientDlg.h : header file
//

#if !defined(AFX_CLIENTDLG_H__4D917FA7_3BFE_11D4_8C39_0000E839EC5E__INCLUDED_)
#define AFX_CLIENTDLG_H__4D917FA7_3BFE_11D4_8C39_0000E839EC5E__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CClientDlg dialog

#include "ChatSocket.h"

class CClientDlg : public CDialog
{
// Construction
public:
	CClientDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CClientDlg)
	enum { IDD = IDD_CHATCLIENT_DIALOG };
	CListBox	m_ListMsg;
	CString	m_strMsg;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CClientDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CClientDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnDestroy();
	afx_msg void OnSend();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

//Attribute
	//自动对话判断
	BOOL m_bAutoChat;
	//客户机名称
	CString m_strHandle;
	//套接字对象
	CChatSocket* m_pSocket;
	//CSocketFile对象
	CSocketFile* m_pFile;
	//CArchive对象
	CArchive* m_pArchiveIn;
	CArchive* m_pArchiveOut;

//Operations
public:
	//建立连接
	BOOL ConnectSocket(LPCTSTR lpszHandle,LPCTSTR lpszAddress,UINT nPort);
	//读取信息
	void OnReceive();
	//发送消息
	void SendMsg(CString& strText);
	//接收消息
	void ReceiveMsg();
	//显示消息
	void DisplayMsg(LPCTSTR lpszText);
};

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

#endif // !defined(AFX_CLIENTDLG_H__4D917FA7_3BFE_11D4_8C39_0000E839EC5E__INCLUDED_)

⌨️ 快捷键说明

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