Next: Classes(MFC)
Up: MFC
Top: Top
3.14.1. Introduction
MFC's primary design goals are to provide an efficient, compact, fast,
easy-to-use, typesafe, and portable version of the Windows API for
the C++ programmer. A secondary goal is to provide Collection classes,
diagnostic memory management, etc, for DOS and Windows programmers.
MFC is implemented without the use of language-extensions, allowing the
library to be ported to other C++ conformant compilers [although right now
MFC is only shipping with the C7 compiler.] MFC closely follows the naming
conventions and use of the "C" Windows API so that programmers experienced
in Windows programming find it easy to switch from C to the C++ APIs.
However the "lower level" aspects of Windows programming are improved
upon by MFC. For example wparam, lparam packing/unpacking is handled
automatically and in a type safe manner. Also the main message loop is
handled automatically.
Switch statements are replaced with the use of virtual functions and/or
cached message dispatch that avoid slow message searches. Finally, the
C++ Windows classes are implemented in such a manner as to remain compatible
with the C implementations, such that Windows programmers can still use
the C APIs where desired, and/or can mix old implementations of Windows
classes implemented in "C" with new Windows classes written in C++.
Namespace collisions with other libraries are avoided by using an uppercase
"C" prefix on the MFC Windows classes. MFC includes support for OLE,
DDE, Multimedia, and Windows for Pen Computing. Applications written using
MFC are automatically pen aware.