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

📄 clientdlg.h

📁 面向软件工程的Visual C++网络程序开发
💻 H
字号:
// ClientDlg.h : header file
//

#if !defined(AFX_CLIENTDLG_H__2776B7EA_1E59_469E_9A5C_DB8D4D9DC891__INCLUDED_)
#define AFX_CLIENTDLG_H__2776B7EA_1E59_469E_9A5C_DB8D4D9DC891__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CClientDlg dialog
#include "ClientSocket.h"
#include "ChatSocket.h"
#include "..\\Common.h"

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

// Dialog Data
	//{{AFX_DATA(CClientDlg)
	enum { IDD = IDD_CLIENT_DIALOG };
	CEdit	m_edtState;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CClientDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL
public:
	//////////////////////////////////////////////////////////////////////////
	BOOL	AddNameList();
	void	AddMessage(CString& message);
	void	CreateChatSocket();
	//////////////////////////////////////////////////////////////////////////
	void		AddUserInfo(USER_INFO* info) {
		m_UserList.AddTail(info);
	}
	BOOL		DelUserInfo(USER_INFO* info);
	USER_INFO*	FindUserInfo(SOCKADDR_IN& addr);
	void		ResetUserInfo();
	//////////////////////////////////////////////////////////////////////////
	CClientSocket*	GetClientSocket() {
		return m_pSocket;
	}
	void	SetClientSocket(CClientSocket* pNew) {
		m_pSocket = pNew;
	}
	//
	CString&	GetUserName() {
		return m_strUserName;
	}
	CString&	GetUserPassword() {
		return m_strPassword;
	}
	CString&	GetHostAddr() {
		return m_strHostAddr;
	}
	UINT		GetHostPort() {
		return m_uHostPort;
	}
	//
//	CString&	GetCurrentMessage() {
//		return m_strCurMsg;
//	}
//	void		SetCurrentMessage(CString& strMsg) {
//		m_strCurMsg = strMsg;
//	}
	//
	CList<USER_INFO*, USER_INFO*>& GetUserList() {
		return m_UserList;
	}
	//
	void	SetConnected(BOOL bConn = TRUE) {
		m_bConnected = bConn;
	}
	// Implementation
protected:
	HICON				m_hIcon;
	CClientSocket*		m_pSocket;  //
	CChatSocket*		m_pChatSock; //
	CList<USER_INFO*, USER_INFO*>	m_UserList; // user list
	// CString				m_strCurMsg; // current message received
	//
	CString				m_strUserName;
	CString				m_strPassword;
	CString				m_strHostAddr;
	UINT				m_uHostPort;
	//
//	UINT				m_uChatPort;
	//
	BOOL				m_bConnected;

	// Generated message map functions
	//{{AFX_MSG(CClientDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnNetworkLogin();
	afx_msg void OnNetworkLogout();
	afx_msg void OnNetworkExit();
	afx_msg void OnSelchangeNamelistCombo();
	afx_msg void OnClose();
	afx_msg void OnDestroy();
	afx_msg void OnSendmessageButton();
	afx_msg void OnCancelButton();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_CLIENTDLG_H__2776B7EA_1E59_469E_9A5C_DB8D4D9DC891__INCLUDED_)

⌨️ 快捷键说明

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