Okay, can someone please explain to me the steps I have to take to add functionality to a derived control? Say I want to derive a control from CEdit, which only allows numbers (like the example in my book)
I did everything my book said to do about creating your own derived controls, but yet it still doesn't work.
ClassWizard->Add Class->New->Base Class: CEdit; Name: CNumericalEdit
Add Windows Message Handler for WM_CHAR in CNumericalEdit which looks like the following:
void CNumericalEdit::OnChar(UINT nChar, UINT nRepCount, UINT nFlags)
if (0 <= nChar && 9 >= nChar)
CEdit::OnChar(nChar, nRepCnt, nFlags);
Then, ClassWizard->Member Variables->IDC_EDIT1->Add Variable->Categoty: Control; Type: CNumericalEdit
Voila. Now to test it, we build and try typing some characters into the CNumericalEdit box... and they still freaking show up. What am I doing wrong?