65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.79/5 (13 votes)

Jun 30, 2003

CPOL

1 min read

viewsIcon

82753

downloadIcon

1108

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