The Microsoft Foundation Classes are a framework for developing complete applications in C++. MFC provides two primary functions:
An object-oriented wrapper for the native Windows user-interface API
Framework facilities that remove much of the grunge work involved in making a complete, standalone Windows application
The object-oriented wrapping is straightforward. Many Windows API
functions take a “handle” as their first parameter; for
example, the function
SendMessage() takes a handle
to a window (an
DrawText() takes a handle to a device context (an
HDC) and so forth. MFC wraps most of these handles
in objects and thus provides
CDC classes, both of which have the relevant
So, instead of writing your C++ code as:
HWND hwnd = CreateWindow(...); // Create a handle to the window... EnableWindow(hwnd); // and enable it.
You may write code similar to:
CWnd wnd; // Create a window object. wnd.CreateWindow(...); // Create the Window. wnd.EnableWindow();// And enable it.
There are a large number of objects, including generic window objects, frame windows, MDI child windows, property pages, fonts, dialogs, etc. It’s a large object model, so a good MFC text or the MFC documentation is recommended for anything more than casual use from Python.
The framework aspects of MFC provides some useful utility classes, both for structuring your application and performing many of the mundane tasks a good Windows application should do. The mundane but useful tasks ...