WynApse Home Page
Home    Blog    Contact       
Latest Article:
Read my CoDe Magazine Article
My Tags:
Hosted by:


3 Months FREE!

Ask me how to get 6 months free.


Lifetime Member:


web tracker

Over 3200671 Pages Served


Custom MFC Base Classes in C++


Download the source code

Working in VS 6.0 in C++ is a bit different than working in the .NET world. In later versions, many of the niceties of VB have been brought over to either C++ or C#, but in the bad-old-days of VS6, when the customer wanted something special done to a dialog, you better be prepared to either say "No", or get a bit lower into the code than you might otherwise have desired.

The relevancy of this article may be in question, but I still know many developers working for places using VS6 today (January, 2006).

The Need

I found myself having to hack 'identity' types of changes into dialogs for a customer to give them their look-and-feel. After a couple passes at this, I decided there had to be a good way to resolve the problem of having to modify an ever-changing number of dialog boxes every time another focus group viewed the application.

The Solution

There is a solution, but if you are many classes into your application, the solution may not be for you. If you are just starting a project, this is definitely the way to go.

The solution requires simply putting a piece of code between our dialogs and the MFC CDialog class. This is very easy to do, and provides you with a way to make a single code-change propogate through each dialog in your project.

In projects since this article was first written (1999), I have consistently built a project-specific base class to inherit all dialogs from, and this became the launching pad for the application skinning I did in 2001-2002. You can view an explanation of the skinning project here.

Revisiting this article for modification for release on these pages was an interesting exercise, since I have not used VS6.0 since March of 2005, but I was able to work my way through the changes and get it all rebuilt.

Go to Page 2

RSS:  rss URL

Microsoft MVP

Member of WPF and Silverlight Insiders

Creative Commons License
Check out our book:
Our Book
Advertise on this site through Lake Quincy Media
Copyright © 2006-2010, WynApse