-1

I'm planning to port or rewrite an MFC GUI C++ app, to use in a GNU/Linux environment, and hopefully make it cross-platform. The app has few, if any, dependencies other than MFC and the standard C++ library.

The thing is, I have very little experience in GUI app programming, and in programming for Windows.

My question: What does "de-MFC'ing" an application typically consist of? On the lowest level, every piece of code depending on MFC headers needs to be replaced with alternative code or an alternative dependency or both, but I would like a higher-level sketch of what the challenges and the kinds of effort required.

Notes:

  • I intentionally haven't described the application, to focus the question on de-MFC'ing as a process.
  • In case it matters - I have significant C++ experience, just not with MFC and Windows.
  • Assume the app is "MFC-heavy", i.e. its reliance on MFC isn't just for the GUI, it goes all in on what MFC offers. But no other libraries (or rather, you can ignore anything else).
  • The GUI aspect is important...
einpoklum
  • 2,752

1 Answers1

2

Done that, in different directions.

You want to have your app, with additional header files, and some source files implementing the same functionality for windows and Linux (where the code needs to be different).

Move your code, as it is, to a different build machine (Linux in your case) and try to build it. Then you go to your very first file with errors and fix them. For example, if the compiler complains about “#include <windows.h>” you add a file gui.h, include it, and fill it with declarations as needed.

Done that, first day I had about 4,400 errors (because the compiler stopped at 100 errors in a file). Some months later the app built.

gnasher729
  • 49,096