Home | Overview | How Do I | Tutorial
Note Virtual functions can not be added to an ATL COM object using ClassView, WizardBar, or ClassWizard.
You can use ClassView, WizardBar, or ClassWizard to override virtual functions defined in a base class.
To override a virtual function with ClassView or WizardBar
-or-
Using WizardBar's Class drop-down list, select a class, then on the Action menu click Add Virtual Function.
// CChildFrame message handlers
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here
// or call the base class
CMDIChildWnd::ActivateFrame(nCmdShow);
}
If you want to edit the virtual function you are adding, click Add and Edit; this navigates to the file in which the new virtual function is implemented.
To override a virtual function with ClassWizard
ClassWizard appears.
The Messages box displays a list of virtual functions you can override and a list of Windows messages. The virtuals come before the messages and appear in mixed case.
The function is created and its name displayed in the Member Functions box. The names of virtual overrides are preceded by a gray glyph containing the letter "V" (handlers have a "W").
See Also Adding a Class, Adding a Member Function, Adding a Member Variable, Adding a Message Handler, Deleting a Member Function, Navigating the Class Structure