troubleshooting Question

MFC Architecture, DLLs and Globals Domination, What's the best way to "Rule the World"?

Avatar of kellycoinguy
kellycoinguy asked on
System Programming
7 Comments1 Solution344 ViewsLast Modified:

I'm working on an MFC application that has #ifdefs throughout the source code and in the rc files that produce several different output programs. Each of these programs differ from each other somewhat, but they share 90% of their code and resources in common.

Every time that we create a new program based on this code base, we do a fork in the revision control system, do the changes by introducing a new #ifdef regimen, and finally we painfully merge the program back into the main code source after the program has been released. It's a rather difficult to keep everything straight.

So, what I'm thinking about doing is creating a base class that holds the "application", and subclass for each different application. A factory method would then instantiate the right subclass based upon a configuration file or something. So far so good.

The problem comes with respect to DLLs and EXEs. I'm thinking that the base class, and the subclasses should reside in a DLL, not the main EXE, and that the main EXE should be skeletal. Does that make sense to anyone else?

This configuration thing with multiple programs from one MFC source is kind of tricky business.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros