I'm trying to create an owner draw button using the subclassing. Below are the steps that I followed to achieve this task:

1. Using the resource editor (my application is a dialog box),I added a button and I selected the owner draw style.

2. I added a new class derived from CButton, called CMyButton.

3. In the dialog box class (derived from CDialog), I added a member variabile m_Button of type CMyButton using the class wizard. A DDX_Control function was added.

4. In the CMyButton class I override the DrawItem function where I should draw the button.

BUT SURPRISE ! This function is never called, even if, in my opinion I did all the steps to subclass the button. The code from it is never called. In the debug version I get stucked into
this sequence of code:


// Derived class is responsible for implementing all of these handlers
// for owner/self draw controls
void CButton:rawItem(LPDRAWITEMSTRUCT)
{
ASSERT(FALSE);
}


, belonging to the WINCTRL1.CPP.
Why's that ? I really don't have a clue.
I WILL CERTAINLY GIVE POINTS FOR A USEFUL ANSWER.
I even tried to change the code: I dropped the owner draw style of the button using the resource editor, and in the CMyButton::PreSubclassWindow handler I made the button owner draw using the ModifyStyle function. The result was the same, CMyButton:rawItem is never called.

I'm using VISUAL C++ 5.0 under WIN 2000 PROFESSIONAL.
10x in advance