Click here to Skip to main content
15,867,308 members
Articles / Desktop Programming / MFC
Article

ClassWiz: A VS.NET addin that provides a classwizard similar to that in VC++ 6.0

Rate me:
Please Sign up or sign in to vote.
4.79/5 (14 votes)
29 Jun 2003CPOL1 min read 81.2K   1.1K   28   16
A VS.NET addin that provides a classwizard similar to that in VC++ 6.0

Sample screenshot

Introduction

I wrote the classwiz addin to get a class wizard similar to that in Visual C++ 6.0 in VS.NET 2003. The main functionality which I needed was to be able to override any virtual function, not just a small set of functions in a subset of base classes which VS.NET 2003 currently allows. I felt quite odd why the functionality to override functions like that in VC#.NET is not available for VC++.NET. Luckily VC++.NET provides lot of control through automation that makes it not very difficult to implement such a feature through custom addins. ClassWiz relies heavily on VC++ code model to do its job. Currently, the addin is quite useful to automate overriding of virtual functions for any custom class. Later I want to enhance the addin to provide more functionality like overriding window messages and commands.

How to Use

Here are the few simple steps to use the addin.

  1. Download the demo project and extract ClassWiz.dll
  2. Register classwiz.dll using regsvr32 classwiz.dll from command line.
  3. When you launch VS.NET 2003 you will see a new option called "Class wizard" within the Tools menu. Currently the addin does not work for VS.NET 2002.
  4. Selecting the menu option will bring the dialog box shown in the image
  5. The top tree view shows the base classes of a selected class and the bottom tree view shows the derived classes
  6. You can highlight a function in the top treeview and click on add function to override the function in your derived class
  7. You can also delete a function by clicking the "Delete Function" button

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionCan this Class Wizard work on the new Visual Studio 2008 for MFC Pin
JPM200930-Oct-08 13:31
JPM200930-Oct-08 13:31 
Questiongood job but... Pin
hsm22-Nov-06 3:55
hsm22-Nov-06 3:55 
Generalcome this way Pin
ccppca24-Feb-05 4:50
ccppca24-Feb-05 4:50 
GeneralRe: come this way Pin
John M. Drescher3-Feb-06 11:22
John M. Drescher3-Feb-06 11:22 
QuestionHow to generate a App Wizard similar to ClassWiz? Pin
Franz Klein1-Dec-04 5:51
Franz Klein1-Dec-04 5:51 
GeneralBooks for Visual C++ 2003 IDE Pin
Vikash Dubey27-Sep-04 20:39
Vikash Dubey27-Sep-04 20:39 
GeneralUsing MFC in ADD-Ins Pin
Franz Klein21-Sep-04 1:26
Franz Klein21-Sep-04 1:26 
GeneralRe: Using MFC in ADD-Ins Pin
Anna-Jayne Metcalfe3-Jan-06 0:30
Anna-Jayne Metcalfe3-Jan-06 0:30 
GeneralDoesn't work Pin
Nikolay Unguzov21-Jan-04 3:47
Nikolay Unguzov21-Jan-04 3:47 
GeneralRe: Doesn't work Pin
JabraJabra23-Jan-05 5:52
JabraJabra23-Jan-05 5:52 
GeneralRe: Doesn't work Pin
attempter14-Apr-05 8:58
attempter14-Apr-05 8:58 
GeneralRe: Doesn't work Pin
John M. Drescher3-Feb-06 11:35
John M. Drescher3-Feb-06 11:35 
QuestionHow to make it work on VS.NET 2002? Pin
Agent of FBI3-Oct-03 14:41
Agent of FBI3-Oct-03 14:41 
GeneralDear Code programmers Pin
Tarek A.4-Jul-03 5:43
Tarek A.4-Jul-03 5:43 
GeneralRe: Dear Code programmers Pin
jhaga4-Jul-03 6:11
professionaljhaga4-Jul-03 6:11 
GeneralRamayana Pin
Nish Nishant30-Jun-03 19:15
sitebuilderNish Nishant30-Jun-03 19:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.