MFC - Overview

The Microsoft Foundation Class (MFC) library provides a set of functions, constants, data types, and classes to simplify creating applications for the Microsoft Windows operating systems. In this tutorial, you will learn all about how to start and create windows based applications using MFC.


We have assumed that you know the following −

  • A little about programming for Windows.
  • The basics of programming in C++.
  • Understand the fundamentals of object-oriented programming.

What is MFC?

The Microsoft Foundation Class Library (MFC) is an "application framework" for programming in Microsoft Windows. MFC provides much of the code, which are required for the following −

  • Managing Windows.
  • Menus and dialog boxes.
  • Performing basic input/output.
  • Storing collections of data objects, etc.

You can easily extend or override the basic functionality the MFC framework in you C++ applications by adding your application-specific code into MFC framework.

MFC Framework

  • The MFC framework provides a set of reusable classes designed to simplify Windows programming.

  • MFC provides classes for many basic objects, such as strings, files, and collections that are used in everyday programming.

  • It also provides classes for common Windows APIs and data structures, such as windows, controls, and device contexts.

  • The framework also provides a solid foundation for more advanced features, such as ActiveX and document view processing.

  • In addition, MFC provides an application framework, including the classes that make up the application architecture hierarchy.

Why MFC?

The MFC framework is a powerful approach that lets you build upon the work of expert programmers for Windows. MFC framework has the following advantages.

  • It shortens development time.

  • It makes code more portable.

  • It also provides tremendous support without reducing programming freedom and flexibility.

  • It gives easy access to "hard to program" user-interface elements and technologies.

  • MFC simplifies database programming through Data Access Objects (DAO) and Open Database Connectivity (ODBC), and network programming through Windows Sockets.