Click here to Skip to main content
15,867,885 members
Articles / Desktop Programming / MFC

Validating Edit Controls

Rate me:
Please Sign up or sign in to vote.
4.86/5 (68 votes)
21 Mar 2004CPOL24 min read 687.6K   10K   163  
CEdit-derived classes which validate the most popular types of data input.
// ValidatingEditDemo.h : main header file for the VALIDATINGEDITDEMO application
//

#if !defined(AFX_VALIDATINGEDITDEMO_H__47C40B3C_B2C8_11D5_938E_0002A50C1C28__INCLUDED_)
#define AFX_VALIDATINGEDITDEMO_H__47C40B3C_B2C8_11D5_938E_0002A50C1C28__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

/////////////////////////////////////////////////////////////////////////////
// CValidatingEditDemoApp:
// See ValidatingEditDemo.cpp for the implementation of this class
//

class CValidatingEditDemoApp : public CWinApp
{
public:
	CValidatingEditDemoApp();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CValidatingEditDemoApp)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL

// Implementation

	//{{AFX_MSG(CValidatingEditDemoApp)
		// 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_VALIDATINGEDITDEMO_H__47C40B3C_B2C8_11D5_938E_0002A50C1C28__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
I've done extensive work with C++, MFC, COM, and ATL on the Windows side. On the Web side, I've worked with VB, ASP, JavaScript, and COM+. I've also been involved with server-side Java, which includes JSP, Servlets, and EJB, and more recently with ASP.NET/C#.

Comments and Discussions