MFC – Microsoft Foundation Classes

image Microsoft Foundation Classes are a set of C++ classes provided by Microsoft and distributed with the Windows SDK (Software Development Kit).  The Windows SDK is included with the Microsoft Visual Studio IDE too.

Prior to MFC, writing programs for Windows was incredibly difficult by today’s standards.  A programmer had to become intimately familiar with many of the global Win32 API function calls and data structures embedded in the Windows Operating System.  This was very cumbersome and had a very high learning curve and was very prone to error.  For example, to write code to display simply a blank window, took about 50 lines of code.

MFC is a set of C++ classes that wrap around (or hide or abstract) the cryptic Win32 API function calls.  So, instead of creating multiple, archaic data structures, populating their large amount of fields with data, and passing them to the multiple Win32 function calls in the OS, you can now just instantiate an object of type CWindow, set a few properties, and call a method or two to display your window.  It greatly simplified Windows programming.

Speaking of improvements to Windows development, it would be irresponsible to leave out .NET development.  Programming in C# with the .NET framework greatly simplifies Windows development by an order of magnitude beyond what MFC provided with C++.

Leave a Reply