www.pudn.com > ChatRoom.zip > ClientSelectDlg.h, change:2011-04-24,size:1251b


// ClientSelectDlg.h : 头文件 
// 
 
#pragma once 
#include "afxwin.h" 
 
#include <WinSock2.h> 
 
#pragma comment(lib,"ws2_32.lib") 
 
 
// CClientSelectDlg 对话框 
class CClientSelectDlg : public CDialog 
{ 
// 构造 
public: 
	CClientSelectDlg(CWnd* pParent = NULL);	// 标准构造函数 
 
// 对话框数据 
	enum { IDD = IDD_CLIENTSELECT_DIALOG }; 
 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持 
 
 
// 实现 
protected: 
	HICON m_hIcon; 
 
	// 生成的消息映射函数 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 
	afx_msg void OnPaint(); 
	afx_msg HCURSOR OnQueryDragIcon(); 
	DECLARE_MESSAGE_MAP() 
public: 
	CListBox m_lstRecvMsg; 
public: 
	CEdit m_edtSendMsg; 
 
protected: 
	//加载库函数 
	BOOL InitWinSock(); 
	static UINT ThreadTalking(LPVOID lParam); 
	void CloseWinSock(); 
	void Close(); 
	BOOL socketSelect(SOCKET hSocket,int nTimeOut = 100,BOOL bRead = TRUE); 
 
 
protected: 
	BOOL m_bInitWinSock; 
	//和线程有关的一些变量 
	HANDLE m_hEndTalkingEvent; 
	HANDLE m_hStopWorkingEvent; 
	CWinThread* m_pThreadTalking; 
	SOCKET m_socketServer; 
 
 
public: 
	afx_msg void OnDestroy(); 
public: 
	afx_msg void OnButConnect(); 
public: 
	afx_msg void OnBnClickedButSend(); 
};