mirror of
https://gitee.com/ldcsaa/HP-Socket.git
synced 2024-12-05 05:07:46 +08:00
62 lines
1.6 KiB
C++
62 lines
1.6 KiB
C++
|
|
// ClientDlg.h : header file
|
|
//
|
|
|
|
#pragma once
|
|
#include "afxwin.h"
|
|
#include "../../../Include/HPSocket/HPSocket-SSL.h"
|
|
#include "../../Global/helper.h"
|
|
|
|
|
|
// CClientDlg dialog
|
|
class CClientDlg : public CDialogEx, public CTcpClientListener
|
|
{
|
|
// Construction
|
|
public:
|
|
CClientDlg(CWnd* pParent = NULL); // standard constructor
|
|
|
|
// Dialog Data
|
|
enum { IDD = IDD_CLIENT_DIALOG };
|
|
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
|
|
|
// Implementation
|
|
protected:
|
|
HICON m_hIcon;
|
|
|
|
// Generated message map functions
|
|
virtual BOOL OnInitDialog();
|
|
afx_msg void OnPaint();
|
|
afx_msg HCURSOR OnQueryDragIcon();
|
|
afx_msg void OnBnClickedSend();
|
|
afx_msg void OnBnClickedStart();
|
|
afx_msg void OnBnClickedStop();
|
|
afx_msg LRESULT OnUserInfoMsg(WPARAM wp, LPARAM lp);
|
|
afx_msg int OnVKeyToItem(UINT nKey, CListBox* pListBox, UINT nIndex);
|
|
DECLARE_MESSAGE_MAP()
|
|
public:
|
|
void SetAppState(EnAppState state);
|
|
private:
|
|
virtual EnHandleResult OnSend(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
|
|
virtual EnHandleResult OnReceive(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
|
|
virtual EnHandleResult OnClose(ITcpClient* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode);
|
|
virtual EnHandleResult OnConnect(ITcpClient* pSender, CONNID dwConnID);
|
|
virtual EnHandleResult OnHandShake(ITcpClient* pSender, CONNID dwConnID);
|
|
private:
|
|
CEdit m_Content;
|
|
CButton m_Send;
|
|
CListBox m_Info;
|
|
CEdit m_Address;
|
|
CEdit m_Port;
|
|
CButton m_Async;
|
|
CButton m_Start;
|
|
CButton m_Stop;
|
|
|
|
EnAppState m_enState;
|
|
BOOL m_bAsyncConn;
|
|
|
|
CSSLPackClientPtr m_Client;
|
|
};
|