Microsoft Foundation Classes

From Academic Kids

Microsoft Foundation Classes, or MFC, is a Microsoft library that wraps portions of the Windows API in C++ classes, forming an application framework. Classes are defined for many of the handle-managed Windows objects and also for predefined windows and common controls.

MFC was introduced in 1992 with Microsoft's C/C++ 7.0 compiler for use with 16-bit versions of Windows. It was part of an overall Microsoft effort to gain market share for development tools, and was designed to be something of a showcase of the capabilities of the C++ programming language. C++ was just beginning to replace C for development of commercial application software and C/C++ 7.0 was the first of Microsoft's compilers to add C++ support. MFC was inspired by, and owes much of its structure to the Think Class Library (TCL) on Macintosh, later bought by Symantec.

The Object Windows Library (OWL) was a competing product introduced by Borland around the same time, and was designed for Borland's Turbo C compiler. Since it more strictly followed some OO design guidelines, OWL was more popular than MFC for a time. However, it lost market share when OWL updates lagged the addition of new features to Windows, and when Borland released a new version of the framework incompatible with earlier editions. It was discontinued as Borland began licensing MFC from Microsoft.

When MFC was introduced, Microsoft extended the C++ syntax with a series of macros for management of windows messages, exceptions, and dynamic class instantiation. The syntactic changes for windows messages were intended to reduce memory required by avoiding gratuitous vtable use and provide a more concrete structure for various Visual C++-supplied tools to edit and manipulate code without parsing the full language. The message-handing macros replaced virtual function mechanism provided by C++. Because some versions of the macros defeated the type checking done by the compiler, their use has been a fruitful source of bugs for users of MFC. The macros which implemented serialization, exception support, and dynamic runtime types were less problematic, and predated availability of standards-based language extensions by a number of years. 32-bit versions of MFC, for Windows NT 3.1 and later Windows operating systems, retained these features in the interest of compatibility.

As a practical matter, the chief advantage of MFC is that it provides an object-oriented programming model to the Windows APIs. Another advantage of MFC are C++ wrapper types for many common Windows resource-related data types that provide automatic closure of handles when the objects creating them go out of scope. Additionally, MFC provides a Document/View framework for creating Model-View-Controller-based architectures.

Once highly promoted by Microsoft, emphasis on MFC has been eclipsed by a number of other technologies. Microsoft placed more emphasis on Visual Basic as a commercial software development tool as it became clear that C++ and MFC were too complex for many programmers. Windows Forms is the .NET RAD successor to Visual Basic and MFC. Native C++ programs can use Windows Forms by adding C++ Managed Extensions.

MFC continues to be used for new development by shops that have made a strategic commitment to C++ and the Windows platform.

External links

de:Microsoft Foundation Classes fr:Microsoft foundation class zh:MFC he:Microsoft Foundation Classes


Academic Kids Menu

  • Art and Cultures
    • Art (
    • Architecture (
    • Cultures (
    • Music (
    • Musical Instruments (
  • Biographies (
  • Clipart (
  • Geography (
    • Countries of the World (
    • Maps (
    • Flags (
    • Continents (
  • History (
    • Ancient Civilizations (
    • Industrial Revolution (
    • Middle Ages (
    • Prehistory (
    • Renaissance (
    • Timelines (
    • United States (
    • Wars (
    • World History (
  • Human Body (
  • Mathematics (
  • Reference (
  • Science (
    • Animals (
    • Aviation (
    • Dinosaurs (
    • Earth (
    • Inventions (
    • Physical Science (
    • Plants (
    • Scientists (
  • Social Studies (
    • Anthropology (
    • Economics (
    • Government (
    • Religion (
    • Holidays (
  • Space and Astronomy
    • Solar System (
    • Planets (
  • Sports (
  • Timelines (
  • Weather (
  • US States (


  • Home Page (
  • Contact Us (

  • Clip Art (
Personal tools