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

📄 mytcpclientdlg.h

📁 WinCE EVC4.2 TCP/IP客户端程序,可以和服务器端程序建立连接聊天
💻 H
字号:
// MyTCPClientDlg.h : header file
//

#if !defined(AFX_MYTCPCLIENTDLG_H__4191434E_C843_43F3_B6D7_307752F128EC__INCLUDED_)
#define AFX_MYTCPCLIENTDLG_H__4191434E_C843_43F3_B6D7_307752F128EC__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "TCPClient_CE.h"
/////////////////////////////////////////////////////////////////////////////
// CMyTCPClientDlg dialog

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

// Dialog Data
	//{{AFX_DATA(CMyTCPClientDlg)
	enum { IDD = IDD_MYTCPCLIENT_DIALOG };
	CString	m_recvData;
	CString	m_remoteHost;
	int		m_remotePort;
	CString	m_sendData;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMyTCPClientDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnHelpInfo();
	afx_msg void OnBtnconn();
	afx_msg void OnBtndisconn();
	afx_msg void OnBtnsenddata();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	//定义CTCPClient_CE对象
	CTCPClient_CE m_tcpClient;
private:
	//连接断开事件处理函数
	static void CALLBACK OnDisConnect(CWnd* pWnd);
	//当有数据接收事件处理函数
	static void CALLBACK OnRead(CWnd* pWnd,const char * buf,int len );
	//Socket错误事件处理函数
	static void CALLBACK OnError(CWnd* pWnd,int nErrorCode);
private:
	//得到本地的IP地址
	CString GetLocalIP();

};

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

#endif // !defined(AFX_MYTCPCLIENTDLG_H__4191434E_C843_43F3_B6D7_307752F128EC__INCLUDED_)

⌨️ 快捷键说明

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