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

📄 addipdlg.cpp

📁 It can also accept a number of ftp connection (multithreaded), and with most of the commercial ftp s
💻 CPP
字号:
/****************************************************************/
/*																*/
/*  AddIPDlg.cpp												*/
/*																*/
/*  Implementation of the CAddIPDlg class.						*/
/*	This class is a part of the FTP Server Application			*/
/*																*/
/*  Programmed by Pablo van der Meer							*/
/*  Copyright Pablo Software Solutions 2002						*/
/*	http://www.pablovandermeer.nl								*/
/*																*/
/*  Last updated: 10 july 2002									*/
/*																*/
/****************************************************************/


#include "stdafx.h"
#include "FTPServerApp.h"
#include "ftpserver.h"
#include "AddIPDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


CAddIPDlg::CAddIPDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAddIPDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAddIPDlg)
	m_strIPaddress = _T("");
	//}}AFX_DATA_INIT
}


void CAddIPDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAddIPDlg)
	DDX_Text(pDX, IDC_IPADDRESS, m_strIPaddress);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAddIPDlg, CDialog)
	//{{AFX_MSG_MAP(CAddIPDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/********************************************************************/
/*																	*/
/* Function name : OnInitDialog										*/
/* Description   : Initialize dialog								*/
/*																	*/
/********************************************************************/
BOOL CAddIPDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	if (!m_strTitle.IsEmpty())
		SetWindowText(m_strTitle);	

	// ip address can be 255.255.255.255 = 15 chars max.
	((CEdit *)GetDlgItem(IDC_IPADDRESS))->SetLimitText(15);

	CenterWindow();
	return TRUE;
}


/********************************************************************/
/*																	*/
/* Function name : PreTranslateMessage								*/		
/* Description   : Only accept numeric characters, decimal point	*/
/*				   separators, backspace and tabs.					*/
/*																	*/
/********************************************************************/
BOOL CAddIPDlg::PreTranslateMessage(MSG* pMsg) 
{
	if (pMsg->message == WM_CHAR && pMsg->hwnd == ::GetDlgItem(m_hWnd, IDC_IPADDRESS))
	{
		TCHAR nChar = (TCHAR)pMsg->wParam;
		if ((IsCharAlphaNumeric(nChar) && !IsCharAlpha(nChar)) ||
			nChar == '.' || nChar == '\b' || nChar == '\t')
		{
			return CDialog::PreTranslateMessage(pMsg);
		}
		else
		{
			// eat character
			return TRUE;
		}
	}
	return CDialog::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

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