WEBINAR: On-demand webcast
How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >
This article was contributed by Tom Archer.
IntroductionLike most authors, I try and include a lot of demo applications with my books and articles. It was in the writing of one of my books that I realized that it would be really cool if all of my demo applications were to contain an About box that displayed certain information about me. Then I began to think, Wouldn't it be even better to have a button on the About box that allows the user of my application to automatically go to my web page simply by clicking on a button?
The only problem left was that I had to remember to put this code into every sample application I wrote. Knowing my luck, I just knew that the coolest application in the book would be the only one I'd forget to put the About box on! So, I struck on the idea of learning how to write a Visual C++ Custom AppWizard. Since then (I wrote this AppWizard about 2 years ago), several authors (including Paul DiLascia) have written the so-called "hyperlink control" and as a result more and more developers are including About boxes with hyperlinks to their home pages. For this reason, I finally decided to go ahead and post this article that provides a Custom AppWizard that automatically generates an About box for every application created with it.
Installing and Using the About Custom AppWizard
Simply download the .awx (Custom AppWizard DLL) into your Visual C++ template folder. It couldn't be easier to use! After that, any time you create a new project, you will see a new project type of "MFC AppWizard (exe) - About box" (see image below). Selecting this project type will, along with the standard AppWizard dialogs, present you with a dialog that allows you to enter your name, your web page URL and any general description. This description can be about the program or anything you like. For example, if you are a consultant and you want to advertise your services to anyone who is using your app, you could include information about yourself on the About Box. The Custom AppWizard will do the rest for you. When you run the application and select the About box menu option (SDI and MDI) or click the About button (Dialog app), you will see the information you entered for the app.
Persistent SettingsAnother neat feature I added recently was the ability to save the settings. After all, if you just want to put generic information like your name and URL in the About box, why should you have enter that every time you create a new project. Therefore, every time you create a new project, this information gets saved to the registry just in case you want to re-use it.
More Details on Writing Custom AppWizardsI think that the code is pretty clear and it should be really easy to search and replace what you need to customize the dialog to your particular situation. However, if there's enough interest I will post details on the exact mechanics of writing a Custom AppWizard.
DownloadsDownload source for the Custom AppWizard - 320Kb
Download only the Custom AppWizard DLL (.awx) - 220K