Rant: MFC is DLL Hell...

For my pal Jamie: GUI programming is hard.

So, the big marquee part of Microsoft Visual C++ has been the "Visual" part, where you draw-out your lovely dialog boxes using a GUI creation tool, then the IDE generates the code & and resource files from that.

Okay, so far so good, but I spent most of this morning trying to get this little MFC app I'm upgrading to run as a static EXE instead of a DLL-linked EXE. That would mean the EXE would be a little fatter, but we could ship it without the associated MSVCRT.dll and MFC42.DLL, reducing a point of failure if those files get lost or damaged. It's a win-win, right? Everyone benefits! Bonuses galore!

Except...it doesn't work. The app is structured to run as a .exe with an associated resource dll, loaded with AfxLoadLibrary() instead of just plain LoadLibrary(). I hacked around it so that the app compiled and ran, but it started failing in weird places (ASSERT() statements failing, etc.)

Ultimately, MFC is a limited C++ wrapper atop straight Win32, and it paints you into some serious corners. Joy. :-)

Popular posts from this blog


On "Avengers: Infitnity War"

Closing, 2017