07 December 2006

GUI Toolkits - In Defence Of MFC...

...Or you are stuck with legacy code.

I've already said that MFC isn't as bad as most diatribes make it sound. The macros although seen as antiquated do actually make the code pretty easy to read.

Well, a lot of large and mature applications use MFC as the basis of their user interface, and normally due to the time and number of developers on the application the blurring between UI and the rest of the code might be a bit fuzzy. Some products would have had a clear design from the start to abstract the UI behind a company designed layer of abstraction, but the scary thing is most of these MFC based applications probably started using the built-in app wizard.

With Microsoft trying to force everyone into .NET framework applications they start to avoid putting functionality in MFC and only allowing it through .NET. Fortunately it is still built on the Win32 API and means writing in standard C++ all the new features will be available so long as you roll your sleeves up and dig.

Since Vista will probably be the dominant Windows platform for the forseeable future if you can make your MFC application look good on that platform and look well integrated then you are good to go for another five years at least. It would certainly be worthwhile if you would never be allowed to port your app to another language or another GUI toolkit, be it from time or cost constraints or external pressures. The benefits would be not developing your own solution and also not having the headache of maintenance, which would be critical if the size of your team does not allow for UI type fun. It's certainly the path of least resistance.

With this in mind I decided to investigate MFC extension libraries. There are four I found that are commercially supported. Most of these offerings are simply a case of changing what classes you inherit from. These libraries typically come with source code when you buy a licence.

CodeJock XTreme ToolkitPro
This is the best out of all the ones I have had a look at. Simply it works the smoothest, it looks the nicest and most integrated, and it provides a rich wealth of components. Recent versions have added the Office 2007 style ribbon-bar. The upcoming version 10.4 fixes some outstanding issues with DWM on Vista although they certainly aren't critical. The demo version was certainly a breeze to get up and running.

Prof-UIS
This looks second best. It certainly renders as nice as the CodeJock offering and possibly is not so skinned so it can look more integrated, but when resizing the rendering can take a while to catch up and leaves black areas (this is on Vista). Overall the rendering speed does not seem fast enough. Still, it is a stylish toolkit.

BCGControlBarPro
I think this offering is on par with Prof-UIS, it runs okay and looks good. This one didn't look quite right on Vista but runs fine on XP.

ULTIMATE toolbox
This isn't quite as up to date with the latest features like the previous three but it seems to be well respected and seems to be the most mature.