As many programmers have experienced, VC Class Wizard does not support generation of classes derived from
CObject. Because most of my classes are derived directly or indirectly from
CObject, I decided to create a simple add-in to do the job.
- Generates subclasses from
CObject or derived classes.
- Options to support serialization and versionable schema
- Options to support debugging, AssertValid and Dump
- Optional support for Cocoon documentation generator
- New generated files are added to the current project automatically
- Options are automatically saved in the registry
- Toolbar button to invoke the add-in
- Copy files CreateObjectClass.dll and CreateObjectClass.chm to you add-in directory
- Start Visual Studio
- Select the menu "Tools"-"Customize ..." tab "Add-ins and Macro files"
- Click the "Browse ..." button and select CreateObjectClass.dll
Now you see the CreateObjectClass toolbar, with one button. Click the button and just try it. Please refer to the help file for further details.
- Dynamic object creation is only supported through serialization.
- Some day I will also support
CCmdTarget derived classes (message maps)
- For some reason the new class does not appear in Class View. I think this problem occurred when I switched to service pack 5. You may delete the .opt and the .ncb file of your project to repair this deficiency. If you have any solution, let me know.
- With little effort it is possible to create the file base name programmatically.
- The software would be easier to read if the files are generated in the
OnOk() member function of
CClassSpecificationDialog. I am to lazy to do so now.
You can use this software under the GNU public license conditions. Please let me know if you want to improve the code. If it makes sense, I can include it in the next release.
Sources are included in the download. The core is the class
CClassSpecificationDialog. It is all rather straightforward. The dialog is invoked from the class
CCommands in the function
You need Htmlhelp.lib in order to link. This library is included in Microsoft's HTML Help workshop.