ClassWizard VirtualFilter Options | CodeGuru

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Sep 1, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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 -

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.