I have a Dialog-based applicaton which consist of 3 editboxes which are of CString type. The editboxes are for Firstname, Middlename and Lastname. My editboxes are Alphanumeric since all are of type CString. Now my question is how can I validate my editboxes to accept only alphabets as an input? Is there any Dailog Data Validation routine to perform the validation?
Asked
Active
Viewed 334 times
1 Answers
0
If you look at which DDV_... routines MFC implements, you'll see that there is no validation routine for checking that a string only contains alphanumeric characters. You will need to write your own DDV_xxx validation routine.
With Visual Studio 2010 for example you can look at \Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\dlgdata.cpp
and take the MFC validation routines as a starting point for writing your own validation routine.

Werner Henze
- 16,404
- 12
- 44
- 69