📄 tcpnetkitdlg.h
字号:
// TCPNetKitDlg.h : header file
//
#if !defined(AFX_TCPNETKITDLG_H__9876F860_0DA3_42FB_A418_0D2087D93DEB__INCLUDED_)
#define AFX_TCPNETKITDLG_H__9876F860_0DA3_42FB_A418_0D2087D93DEB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TCPSocket.h"
/////////////////////////////////////////////////////////////////////////////
// CTCPNetKitDlg dialog
class CTCPNetKitDlg : public CDialog
{
// Construction
public:
CTCPNetKitDlg(CWnd* pParent = NULL); // standard constructor
//状态回调
static void OnStatusChange(char *data,int length,DWORD userdata);
//数据回调
static void OnDataArrived(char *data,int length,DWORD userdata);
// Dialog Data
//{{AFX_DATA(CTCPNetKitDlg)
enum { IDD = IDD_TCPNETKIT_DIALOG };
CEdit m_ctrlEditClientLog;
CEdit m_ctrlEditServerLog;
CListCtrl m_ctrlListConnections;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTCPNetKitDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CTCPNetKitDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnDestroy();
afx_msg void OnStartServer();
afx_msg void OnConnect();
afx_msg LONG OnStatusChangedMsg(WPARAM wParam,LPARAM lParam);
afx_msg LONG OnDataArrivedMsg(WPARAM wParam,LPARAM lParam);
afx_msg void OnClientSend();
afx_msg void OnClearServerLog();
afx_msg void OnClearClientLog();
afx_msg void OnClearSend();
afx_msg void OnClickListConnections(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnServerDisconnect();
afx_msg void OnServerSend();
afx_msg void OnClearServerSend();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CTCPSocket* m_psockServer;
CTCPSocket* m_psockClient;
void AddMessage(LPCTSTR msg,int which);
void UpdateList(LPCTSTR Ip,int No,int Operation);
CString m_strLocalIP; //本机计算机IP
CString m_strLocalName; //本机计算机名
int m_nPortLocal;
int m_nPortRemote;
int m_nCurrentSelect;
CString m_strRemoteIP;
BOOL m_bServerCreated;
BOOL m_bClientConnected;
int GetIpAddress(const CString &sHostName,CString &sIpAddress); //获取本机IP
int GetLocalHostName(CString &sHostName); //获取本机计算机名
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TCPNETKITDLG_H__9876F860_0DA3_42FB_A418_0D2087D93DEB__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -