Microsoft's MFC - Mostly Failed Code
Your success lies in porting your code to the next framework, WPF bloatware, Is WinUI3 dead?
The 1990s saw the rise of Windows. Windows offered dozens of new APIs. This is documented in how Microsoft lost the API wars. As Microsoft abandons its crown jewels to chase profits, how does this affect apps develops in MFC?
MFC refers to Microsoft Foundation Code, a set of loosely tied code which wraps the Win16, later Win32S (Win32 subset), Win32, Win-PowerPC (XBOX), Win64 and ARM-powered Windows APIs.
In 1990s, there were three competing APIs - Visual Basic for DOS with it’s iconic TUI (Text User Interface), Borland’s TurboVision and its variants - TurboPower Toolkit, Object Toolkit, TTT, ANSI-based TUIs, Clipper UI libraries.
When Windows 3.11 came and went - leading to Windows NT 3.5.1 then Windows 95, there was a stable API which developers could target their apps.
In DOS, you write directly to C000:000 to C800:000 VGA mapped memory. In Windows, there are a set of APIs (callback routines) to use.
Which UI SDK to use?
In the 1990’s - there were NextStep, Motif (ontop of X-Windows), Borland’s OWL, variants of Motif and X-Windows libraries.
NextStep eventually became foundations of MacOS, Borland OWL and variants - ObjectVision, , became Delphi and C++ Builder, QT becomes part of the KDE desktop…
From MFC 1.0 to MFC 6.0 - from 1992 to 1998 - MFC were thin wrappers across Windows APIs.
There were two choices - use the Windows API directly, or use MFC…, or use an equivalent API framework.
MFC provided partial solutions - just enough code to wrap the Windows API, but not enough to be a complete solution.
Two forces - the rise of browsers in handheld devices and “churn” in APIs.
In Visual Studio 7.0 - NET 1.0 was introduced - to merge ASP, ASP-Javascript (considered an enemy) ASP compatible webservers to a compiled IL (intermediate language) called NET.
Windows XP service packs shipped with NET 1, and NET 2, and provided MFC with C++.NET - a version of C++ that could access NET frameworks.
NET’s failures and new bridges
While NET could be considered success - it never fully made inroads into Android and iOS communities.
NET’s UI frameworks were never popular - Microsoft had no intention to bring WPF or WinForms to MacOS or Linux1. There are third-party frameworks - such as Avalonia, Uno - if you could bear the slowness, malformed UIs, worse gripes than Delphi gripes2.
While most of the credit for cross-platform frameworks goes to React3, Popular apps, such as Walmart, Amazon, YouTube use Jetpack compose, Swift and middleware such as Skiptools4, Compose Multiplatform - with no NET (VB.NET, C# or ILASM usage).
Many early-stage startups begin with React Native or Flutter to build their MVPs as it's more cost-effective. Once their platform gains a considerable user base and have better funding, they often migrate to native development — out of which some do so to improve performance, scalability, or to better leverage platform-specific features.
As Google Play allows certain games to be played on Windows5, iOS apps can be used on MacOS, what is MFC, NET and where does Microsoft’s ecosystem use Android or MacOS effectively?
MFC’s not here
Where is MFC today? In 2010’s - Steam’s Half-Life 1 uses MFC - you can see DirectX 7 and MFC objects used in Half-Life’s level editor. Steam used MFC libraries, then moved to CEF (Chromium Embedded Framework).
Older versions of SandBoxie, older tools like Softel VDM6 where features on trees, tabs, and buttons were a thing, Older SDKs - CodeJock, BCGSoft are relics of the past - if you can make use of CodeJock or BCGSoft and not get bogged or choked by MFC’s incompatibilities to C++17 or C++20.
Native PHP, Native Rust - Visual Studio at Risk
New developments - NativePHP7 wraps Win32 and OSX APIs in PHP APIs, Tauri and Dioxus8 do similar in Rust.
Developing on native PHP or rust does not require a full-blown editor, not that Microsoft bothered - for years, there was no PHP integration with Visual Studio, nor was making PHP debugging usable, nor did buying an add-on DEVSENSE make a difference.
Android on Visual Studio, despite Xamarin’s add-ons, felt like a fish out of water.
Swift on Visual Studio? There is laughter…
Is WinUI3 dead?
Several vendors - Telerik, DevExpress have paused or provide bare-bone UI components.
and9:
WPF, the XML madness
WPF is the “almost there” UI framework. There’s Fast Reports for WinForms, then WPF, then Avalonia.
There are three horses - MAUI, Blazor Hybrid, UNO and Avalonia.
Xamarin was C#’s answer to Android, iOS and Linux development. It wasn’t ideal, as no UI support meant UI-hell10, poorly made OSX apps.
WxWidgets
Switching from MFC to WxWidgets to get native UI only goes so far… What 3rd-party commercial libraries are built with WxWidgets?
Rust’s UI library
Which UI library will you bet on?11 There are 40+ libraries for Rust. Which one will you choose?
Delphi’s VCL
Delphi VCL is considered similar to MFC, minus the bloat.
Software development is becoming more like gambling - put your bets on one box, pray and hope it gets adopted quickly and you’ve made the right choice. Make a wrong choice, you get hosed.
A right bet means a few more years until luck runs out, or costs exceed income…
MFC is on life support for years on end. New features are in NET. There is FOMO (Fear of Missing Out).
What will you choose this year?
DioxusLabs/dioxus: Fullstack app framework for web, desktop, mobile, and more.