socketdlg.h

来自「开发环境为VC++ 的数据库管理系统」· C头文件 代码 · 共 74 行

H
74
字号
#if !defined(AFX_SOCKETDLG_H__ED49777C_77CE_4F01_9547_E7CD4DA24C9F__INCLUDED_)
#define AFX_SOCKETDLG_H__ED49777C_77CE_4F01_9547_E7CD4DA24C9F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SocketDlg.h : header file
//
#include "NDK\NDKClient.h"
/////////////////////////////////////////////////////////////////////////////
// CSocketDlg dialog

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

// Dialog Data
	//{{AFX_DATA(CSocketDlg)
	enum { IDD = IDD_DIALOG_SOCKET };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA
	CString	m_localIp;
	CString	m_strIp;
	long	m_lPort;
	int		message_int;
	CString message_str;
	void DisConn();
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSocketDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
public:
			// NDK: overrides OnMessage, OnDisconnect and OnPing

	// Called when a message is received. The derived class must override this
	// method.
	virtual void OnMessage(CNDKMessage& message);

	// Called whenever an unexpected disconnection occurs. The only case when
	// this method isn't call is when CloseConnection is used. CloseConnection
	// don't need to be called when when OnDisconnect is called. The derived 
	// class must override this method.
	virtual void OnDisconnect(NDKClientDisconnection disconnectionType);

	// Called when the ping from the server is received. The number of
	// milliseconds is returned since PingServer was called.
	virtual void OnPing(long lNbMilliseconds);

	// Generated message map functions
	//{{AFX_MSG(CSocketDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	
private:
	void MsgConn();
//	void UpdateUI();
//	void AddText(const CString& strText);
//  void AddSystemText(const CString& strText);	
};

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

#endif // !defined(AFX_SOCKETDLG_H__ED49777C_77CE_4F01_9547_E7CD4DA24C9F__INCLUDED_)

⌨️ 快捷键说明

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