Recently I spent some time to write add-ins for Visual C++ 6. The most important task was to understand how an add-in works, and the key is to grasp the DevelperStudio object model. Well, the object model is just simple, compared to things in Microsoft Office, but the study also took time and energy. After looking into MSDN articles for some days, I decided to write an add-in to visually show the model. So comes VCGenie.
VCGenie is a simple Visual C++ add-in that has only one useful method:
ShowObjModel. This method invokes a dialog in which you can see the DeveloperStudio object model. It is made up of three components: a normal tree-view to show the hierarchy, a toolbar control with chart legend and a custom-drawn listbox to display properties. Not very special, but I make the listbox's appearance "Delphi/C++Builder Object-Inspector" alike because I've been used to that.
When writing add-ins, I found this little tool very helpful because I can see the object model visually, and from it I can tell which object or property is available. Thus I spent less time to switch between Visual C++ and MSDN.
If you haven't used a Visual C++ add-in before, then the following steps may be helpful:
- Open Visual C++ IDE if it hasn't been opened yet. From the main menu, select Tools | Customize.
- In the "Customize" dialog, pick the "Add-in and macros" page, then click Browse.
- Change the file type to add-in files(*.dll), then navigate to VCGenie directory and select vcgenie.dll.
- After a while, VCGenie will appear in the add-in list. Verify that the check box on the left is selected.
- Click Close. Now you should see the new toolbar in Visual C++ IDE with just one button.
- Click that button to invoke the object model dialog. (To get the best results, open any project first; and then you will see the project's information in this dialog.)
If you want to compile the project yourself, then I should note here that my native language is Simplified Chinese, so you may need to change the project's resource language to your own before any build process is made.
I will be glad to hear any bug report or opinion for VCGenie. If you are a beginner to write add-ins (like me) and find it helpful for you, I will be very happy.