📄 telnet.h
字号:
// telnet.h : main header file for the TELNET DLL
//
#if !defined(AFX_TELNET_H__BA885CC6_2177_11D3_B21E_000021000B39__INCLUDED_)
#define AFX_TELNET_H__BA885CC6_2177_11D3_B21E_000021000B39__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "OptionsDlg.h"
typedef struct
{
SOCKET hSocket; // SOCKET handle
UINT nBytesToSend; // Bytes to send
CByteArray SendBuf; // Send data buffer
UINT nBytesReceived; // Bytes received
CByteArray ReceiveBuf; // Receive data buffer
}SOCKETITEM;
/////////////////////////////////////////////////////////////////////////////
// CTelnetApp
// See telnet.cpp for the implementation of this class
//
class CTelnetApp : public CWinApp
{
public:
CTelnetApp();
// DLL Interface for init (Can be modified)
LPCTSTR GetProtocolName(void); // Get this protocol name
void SetProperties(void); // Set this protocol's properties
void GetTimeOutTime(UINT &nConnectTime, UINT &nVerifyTime); // Get the timeout value
// DLL Interface for communication (No need to modify)
BOOL AddSocket(SOCKET hSocket); // Add socket
BOOL DelSocket(SOCKET hSocket); // Del socket
// DLL Interface for network callback (Developer defined)
void OnConnect(SOCKET hSocket); // When connected, the main process call this
int OnSend(SOCKET hSocket); // When data can be send, the main process call this, return 0-no more data to send, 1-fail
int OnReceive(SOCKET hSocket); // When incoming data is available, the main process call this, return 0-more data available, 6-Free, 7-Need password, 8-Not fit the protocol, 9-no matching string, 11-undecidable
void OnClose(SOCKET hSocket); // When connection closed, the main process call this
protected:
CPtrArray m_SocketArray; // Socket object array
COptionsDlg m_dlgOptions; // The properties dialog (Developer can modify)
SOCKETITEM *FindSocket(SOCKET hSocket); // Find a Socket object using SOCKET handle as the reference
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTelnetApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
//{{AFX_MSG(CTelnetApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TELNET_H__BA885CC6_2177_11D3_B21E_000021000B39__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -