OpenMFC: Running Windows MFC Apps On Other Platforms
Project Master Plan: OpenMFC (v3.1 – Production-Ready)
This article delves into the ambitious OpenMFC project, a fascinating endeavor to reimplement the Microsoft Foundation Class (MFC) runtime in a clean-room environment. This means creating a version that's binary-compatible with the original mfc140u.dll and atl140.dll. The ultimate goal? To allow existing MFC Windows binaries to run seamlessly on non-Windows systems, as well as future platforms, without any modifications. This is achieved by meticulously recreating the behavior and Application Binary Interface (ABI) of the original DLLs. This project acts as a preservation engine for MFC-based software.
🌐 Mission & Vision
The mission of OpenMFC is clear: provide a binary-compatible reimplementation of the Microsoft Foundation Class runtime. This endeavor aims to allow existing MFC Windows binaries to operate without alteration on a variety of systems, including those beyond Windows, as well as emerging platforms. The approach involves a comprehensive recreation of the behavior and ABI inherent to the original DLLs, thereby ensuring seamless functionality across different environments. Ultimately, OpenMFC is envisioned as a critical piece of system infrastructure, akin to projects like Wine, DXVK, or FAudio. It's designed to treat MFC not as a library, but as an integral part of the operating system itself.
Key Aspects of the OpenMFC Mission
- Focus on Drop-In DLL Replacement: The primary objective is to enable applications to function correctly simply by replacing the original DLLs with OpenMFC equivalents. This approach minimizes the need for recompilation, streamlining the process of porting MFC-based applications to new platforms.
- Prioritization of Behavioral and ABI Fidelity: The project places a strong emphasis on accurately replicating the behavior and ABI of the original MFC runtime. This ensures that applications relying on specific MFC functionalities will continue to operate as expected, regardless of the underlying platform.
- MFC as an OS-Level Dependency: By treating MFC as a fundamental component of the operating system, OpenMFC aims to provide a consistent and reliable environment for MFC-based applications. This approach allows developers to focus on application-specific logic, without having to worry about the intricacies of the underlying MFC implementation.
Why This Matters: Use Cases and Benefits
The OpenMFC project addresses several critical needs and offers significant benefits:
- Digital Preservation: OpenMFC plays a vital role in digital preservation, ensuring the longevity of MFC-based applications. Binary compatibility is key to rescuing abandonware line-of-business applications, internal enterprise tools, and old scientific/engineering tools, acting as a preservation engine for MFC-based software.
- Extending Wine's Capabilities: Acting as the "Wine of libraries", OpenMFC reimplements the MFC runtime layer, complementing Wine's reimplementation of core Windows APIs.
- Patching and Enhancement: Owning the DLLs allows for patching bugs, adding logging and telemetry, and introducing theming or accessibility layers without recompilation.
🎯 Goal & Scope
OpenMFC's primary goal is to create a binary-compatible, open-source reimplementation of mfc140u.dll and atl140.dll on Linux using MinGW. This will allow MSVC MFC applications to be linked without any code changes. The scope is limited to x64 architecture, Unicode (W) APIs, and MFC versions VS2015+ (v140). OLE/COM, ActiveX, and Automation are excluded from the initial scope. It must link against and utilize the host process's ucrtbase.dll and vcruntime140.dll to avoid