ClassWizard VirtualFilter Options

I came across a problem with the VC++ ClassWizard a while ago. If you have a class derived from a standard MFC class, ClassWizard will offer to insert handlers for virtual function overrides. For example, for a class derived from CPropertyPage, you can add handlers for OnWizardNext, OnWizardFinish and so on. However, if you derive again, e.g.
CPropertyPage
CWizardPage
CWizPage1

Then ClassWizard will show virtual functions for CWizardPage but not for CWizPage1.

I discovered that this can be fixed by editing the ClassWizard *.CLW file and adding the 'VirtualFilter' option to the appropriate section. For example:

[CLS:WizPage1]
Type=0
BaseClass=WizardPage
HeaderFile=WizPage1.h
ImplementationFile=WizPage1.cpp
Filter=N
LastObject=WizPage1
VirtualFilter=idWC

The right hand side of VirtualFilter is a list of case-sensitive letters specifying which sets of virtual functions will be listed by ClassWizard. So, in the above example, ClassWizard will list virtual functions from CPropertyPage, CDialog, CWnd and CCmdTarget.

Here's the full list:

a CDatabase
b CListBox
c CComboBox
d CDialog
e -
f CFrameWnd
g COleMessageFilter
h CDialog
i CPropertyPage
j -
k CHttpServer
l COleClientItem
m -
n CHttpFilter
o OLE stuff
p CSplitterWnd
q CAsyncSocket
r CRecordSet
s COleDropSource
t COleDopTarget
u COleMessageFilter
v COleServerDoc
w COleControl
x CRecordset
y CAsyncMonikerFile
z -

A CWinApp
B Button? (DrawItem)
C CObject/CCmdTarget
D CDocument
E CEditView
F -
G -
H -
I CDocItem
J -
K -
L COleLinkingDoc
M CMDIFrameWnd
N -
O COleDocument
P COleIPFrameWnd
Q -
R CRecordView
S -
T CWinThread
U -
V CView
W CWnd
X -
Y -
Z -



Comments

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 18, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this upcoming webcast …

  • You already prepare for disasters. In fact, your customers expect it of you. You have plans in place to rebuild servers, network infrastructure, and critical data, right? If you're really on top of things, you have a plan for both natural disasters (such as earthquakes, floods, blizzards, landslides, lightning, and more) as well as man-made disasters (such as power failures, hazardous material spills, fire, and civil unrest), both of which can cause displacement from the business property or damage to a …

Most Popular Programming Stories

More for Developers

RSS Feeds