// NumericEdit.cpp : implementation file // #include "stdafx.h" #include "Walkthrough.h" #include "NumericEdit.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CNumericEdit CNumericEdit::CNumericEdit() {} CNumericEdit::~CNumericEdit() {} BEGIN_MESSAGE_MAP(CNumericEdit, CEdit) //{{AFX_MSG_MAP(CNumericEdit) ON_WM_CHAR() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CNumericEdit message handlers void CNumericEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { // See page 149 for other Virtual Key Codes (VK_??) if(((nChar >= _T ('0')) && (nChar <= _T ('9')) || (nChar == VK_BACK))) { CEdit::OnChar(nChar, nRepCnt, nFlags); } else { ::MessageBeep(MB_ICONASTERISK); } }