Microsoft Foundation Class Library

Last updated

Microsoft Foundation Class Library
Developer(s) Microsoft
Initial release1992;32 years ago (1992)
Stable release
14.22.27821.0 / July 24, 2019 [1]
Written in C++
Operating system Microsoft Windows
License Proprietary
Website docs.microsoft.com/en-us/cpp/mfc/mfc-desktop-applications

Microsoft Foundation Class Library (MFC) is a C++ object-oriented library for developing desktop applications for Windows.

Contents

MFC was introduced by Microsoft in 1992 and quickly gained widespread use. While Microsoft has introduced alternative application frameworks since then, MFC remains widely used.

History

MFC was introduced in 1992 with Microsoft's C/C++ 7.0 compiler for use with 16-bit versions of Windows as an extremely thin object-oriented C++ wrapper for the Windows API. C++ was just beginning to replace C for development of commercial application software at the time. In an MFC program, direct Windows API calls are rarely needed. Instead, programs create objects from Microsoft Foundation Class classes and call member functions belonging to those objects. Many of those functions share their names with corresponding API functions. [2]

One quirk of MFC is the use of "Afx" as the prefix for many functions, macros and the standard precompiled header name "stdafx.h". During early development, what became MFC was called "Application Framework Extensions" and abbreviated "Afx". The name Microsoft Foundation Classes (MFC) was adopted too late in the release cycle to change these references.

MFC 8.0 was released with Visual Studio 2005. MFC 9.0 was released with Visual Studio 2008. On April 7, 2008, Microsoft released an update to the MFC classes as an out-of-band update to Visual Studio 2008 and MFC 9. [3] The update features new user interface constructs, including the ribbons and associated UI widgets, fully customizable toolbars, docking panes which can either be freely floated or docked to any side and document tabs. [4]

MFC was initially a feature of the commercial versions of Visual Studio. As such, it is not included in the freeware Visual C++ Express. [5] The Community edition of Visual Studio, introduced in 2014, however, includes MFC.

Object Windows Library (OWL), designed for use with Borland's Turbo C++ compiler, was a competing product introduced by Borland around the same time. Eventually, Borland discontinued OWL development and licensed the distribution of the MFC headers, libraries and DLLs from Microsoft [6] for a short time, though it never offered fully integrated support for MFC. Borland later released Visual Component Library to replace the OWL framework.

Features

MFC is a library that wraps portions of the Windows API in C++ classes, including functionality that enables them to use a default application framework. Classes are defined for many of the handle-managed Windows objects and also for predefined windows and common controls.

At the time of its introduction, MFC provided C++ macros for Windows message-handling (via Message Maps [7] ), exceptions, run-time type identification (RTTI), serialization and dynamic class instantiation. The macros for message-handling aimed to reduce memory consumption by avoiding gratuitous virtual table use and also to provide a more concrete structure for various Visual C++-supplied tools to edit and manipulate code without parsing the full language. The message-handling macros replaced the virtual function mechanism provided by C++.

The macros for serialization, exceptions, and RTTI predated availability of these features in Microsoft C++ by a number of years. 32-bit versions of MFC, for Windows NT 3.1 and later Windows operating systems, used compilers that implemented the language features and updated the macros to simply wrap the language features instead of providing customized implementations, realizing upward compatibility.

The MFC ribbon resource editor allows the developer to design the ribbon graphically instead of having to use the XML-based declarative markup like the RibbonX API. Optionally, ribbon components may be programmed directly by calling a new set of ribbon class methods. The developer may mix graphical and programmatic ribbon development as is convenient. The MFC application wizard has also been upgraded to support the new features, including a check-box to select whether the application will use the ribbon or the docking panes. The new functionality is provided in new classes so that old applications still continue to run. [4] This update builds on top of BCGSoft’s BCGControlBar Library Professional Edition. [8] Microsoft has imposed additional licensing requirements on users of the ribbons. [9] These include a requirement to adhere to Microsoft UI Design Guidelines, and an anti-competition clause prohibiting the use of the UI in applications which compete with Microsoft Office.

MFC can be used by linking a static library or by adding the MFC DLL.

Versions

ProductLibraryVersionRelease date
NameVersion
Microsoft C/C++ 7.0mafxcw.libMFC 1.01992
Microsoft Visual C++ 1.0Visual C++ 1.0mfc200.dllMFC 2.0
Visual C++ 1.5mfc250.dllMFC 2.5
Visual C++ 1.51mfc250.dllMFC 2.51
Visual C++ 1.52cmfc250.dllMFC 2.5 (Last development platform for Windows 3.x)
Microsoft Visual C++ 2.0Visual C++ 2.0mfc30.dllMFC 3.0
Visual C++ 2.1mfc30.dllMFC 3.1
Visual C++ 2.2mfc30.dllMFC 3.2
Microsoft Visual C++ 4.0Visual C++ 4.0mfc40.dllMFC 4.0 (mfc40.dll included with Windows 95)August 1995
Visual C++ 4.1mfc40.dllMFC 4.1
Visual C++ 4.2mfc42.dllMFC 4.2 (mfc42.dll included with the Windows 98 original release)March 1998
eMbedded Visual C++ 3.0mfc42.dllMFC 4.2
Microsoft Visual C++ 5.0Visual C++ 5.0mfc42.dllMFC 4.21
Microsoft Visual C++ 6.0Visual C++ 6.0mfc42.dllMFC 6.01998
eMbedded Visual C++ 4.0mfcce400.dllMFC 6.0
Microsoft Visual C++ .NET 2002Visual C++ .NET 2002 (Visual C++ 7.0)mfc70.dllMFC 7.0February 13, 2002
Microsoft Visual C++ .NET 2003Visual C++ .NET 2003 (Visual C++ 7.1)mfc71.dllMFC 7.1April 24, 2003
Visual C++ .NET 2003 + MS11-025 (KB2465373) [10] MFC 7.10.6119.0April 12, 2011
Microsoft Visual C++ 2005Visual C++ 2005 (Visual C++ 8.0)mfc80.dll8.0.50727.42April 10, 2006
Visual C++ 2005 SP18.0.50727.762August 27, 2007
Visual C++ 2005 SP1 + MS09-035 (KB973544) [11] [12] 8.0.50727.4053July 28, 2009
Visual C++ 2005 SP1 + MS11-025 (KB2467175) [10] 8.0.50727.5592April 12, 2011
Visual C++ 2005 SP1 + MS11-025 (KB2538242) [10] [13] 8.0.50727.6195 (included in redist 8.0.61000/8.0.61001 [14] )June 14, 2011
Visual C++ 2005 SP1 + MS11-025 (KB2643995) [15] [16] 8.0.50727.62292021-01-25?
Microsoft Visual C++ 2008Visual C++ 2008 (Visual C++ 9.0)mfc90.dll9.0.21022.8November 19, 2007
Visual C++ 2008 + MS09-035 (KB973551) [11] [12] 9.0.21022.218July 28, 2009
Visual C++ 2008 with Feature Pack9.0.30411April 22, 2008
Visual C++ 2008 SP19.0.30729.1August 11, 2008
Visual C++ 2008 SP1 + MS09-035 (KB973552) [11] [12] 9.0.30729.4148July 28, 2009
Visual C++ 2008 SP1 + MS11-025 (KB2467174) [10] 9.0.30729.5570April 12, 2011
Visual C++ 2008 SP1 + MS11-025 (KB2538243) [10] 9.0.30729.6161 (installer has version 9.0.30729.5677)June 14, 2011
Microsoft Visual C++ 2010Visual C++ 2010 (Visual C++ 10.0)mfc100.dll10.0.30319.1April 12, 2010 [17]
Visual C++ 2010 + MS11-025 (KB2467173) [10] 10.0.30319.415April 12, 2011
Visual C++ 2010 SP110.0.40219.1March 10, 2011
Visual C++ 2010 SP1 + MS11-025 (KB2565063) [10] 10.0.40219.325August 9, 2011
Microsoft Visual C++ 2012Visual C++ 2012 (Visual C++ 11.0)mfc110.dll11.0.50727.1September 12, 2012
Visual C++ 2012 Update 111.0.51106.1November 26, 2012
Visual C++ 2012 Update 311.0.60610.1June 26, 2013
Visual C++ 2012 Update 411.0.61030.0November 13, 2013
Microsoft Visual C++ 2013Visual C++ 2013 (Visual C++ 12.0)mfc120.dll12.0.21005.1October 17, 2013
Visual C++ 2013 Update 212.0.30501.0May 12, 2014
Visual C++ 2013 Update 5 + KB313836712.0.40649.5February 2016? [18] [16]
Visual C++ 2013 Update 5 + KB317956012.0.40660.0July 8, 2016 [19]
Visual C++ 2013 Update 5 + KB403293812.0.40664.0July 18, 2017 [20]
Microsoft Visual C++ 2015Visual C++ 2015 (Visual C++ 14.0)mfc140.dll14.0.23026.0July 20, 2015
Visual C++ 2015 Update 114.0.23506.0November 30, 2015 [21]
Visual C++ 2015 Update 214.0.23918.0March 30, 2016 [22]
Visual C++ 2015 Update 314.0.24210.0June 27, 2016 [23]
Visual C++ 2015 Update 314.0.24212.0August 18, 2016
Visual C++ 2015 Update 3 + KB316575614.0.24215.1September 15, 2016 [24]
Visual C++ 2015 Update 314.0.24516.0October 23, 2021
Microsoft Visual C++ 2017Visual C++ 15.0mfc140.dll14.10.25008.0March 7, 2017
Visual C++ 15.1?14.10.25017.0April 5, 2017?
Visual C++ 15.214.11.25325.0May 10, 2017
Visual C++ 15.414.12.25810.0October 9, 2017
Visual C++ 15.614.13.26020.0March 5, 2018
Visual C++ 15.714.14.26405.0May 7, 2018
Visual C++ 15.7.3?14.14.26429.4May 31, 2018
Visual C++ 15.814.15.26706.0August 14, 2018
Visual C++ 15.914.16.27012.6November 13, 2018
Visual C++ 15.9.514.16.27024.1January 8, 2019
Visual C++ 15.9.614.16.27026.1January 24, 2019
Visual C++ 15.9.914.16.27027.1March 12, 2019
Visual C++ 15.9.1514.16.27033.0August 13, 2019
Microsoft Visual C++ 2019Visual C++ 16.0.0mfc140.dll14.20.27508.1April 2, 2019?
Visual C++ 16.1.014.21.27702.2May 21, 2019
Visual C++ 16.2.014.22.27821.0July 24, 2019
Visual C++ 16.3.014.23.27820.0September 23, 2019
Visual C++ 16.4.014.24.28127.4December 3, 2019
Visual C++ 16.5.014.25.28508.3March 16, 2020
Visual C++ 16.6.014.26.28720.3May 19, 2020
Visual C++ 16.6.314.26.28808.1June 30, 2020
Visual C++ 16.7.014.27.29016.0August 5, 2020
Visual C++ 16.7.514.27.29112.0September 29, 2020
Visual C++ 16.7.814.27.29114.0 [note 1] November 10, 2020
Visual C++ 16.8.014.28.29325.2November 10, 2020
Visual C++ 16.8.214.28.29334.0November 19, 2020
Visual C++ 16.9.014.28.29910.0March 2, 2021
Visual C++ 16.9.214.28.29913.0March 16, 2021
Visual C++ 16.9.414.28.29914.0April 13, 2021
Visual C++ 16.10.014.29.30037.0May 25, 2021
Visual C++ 16.10.214.29.30038.0June 15, 2021
Visual C++ 16.10.414.29.30040.0July 20, 2021
Visual C++ 16.11.014.29.30133.0August 10, 2021
Visual C++ 16.11.414.29.30135.0October 5, 2021
Visual C++ 16.11.914.29.30139.0January 11, 2022
Visual C++ 16.11.3214.29.30153.0November 14, 2023
Microsoft Visual C++ 2022Visual C++ 17.0.0RCmfc140.dll14.30.30704.0October 13, 2021
Visual C++ 17.0.514.31.30708.0January 14, 2022
Visual C++ 17.1.014.31.30818.0October 27, 2021
Visual C++ 17.1.014.31.30919.0December 23, 2021
Visual C++ 17.1.014.31.31005.0January 26, 2022
Visual C++ 17.1.014.31.31103.0January 26, 2022
Visual C++ 17.2.014.32.31302.0March 17, 2022
Visual C++ 17.2.014.32.31326.0April 9, 2022
Visual C++ 17.2.514.32.31332.0July 1, 2022
Visual C++ 17.4.014.34.31931.0November 9, 2022
Visual C++ 17.4.514.34.31938.0February 14, 2023
Visual C++ 17.6.014.36.32532.0May 16, 2023
Visual C++ 17.7.114.38.32919.0August 11, 2023
Visual C++ 17.8.014.38.33130.0November 15, 2023
Visual C++ 17.8.614.38.33135.0February 6, 2024
Visual C++ 17.9.414.40.33617.1March 19, 2024

See also

Notes

  1. Last version of library officially supporting Windows XP. [25]

Related Research Articles

Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supported or updated by Microsoft, the VBA implementation in Office continues to be updated to support new Office features. VBA is used for professional and end-user development due to its perceived ease-of-use, Office's vast installed userbase, and extensive legacy in business.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running.

<span class="mw-page-title-main">Microsoft Visual C++</span> Integrated development environment product

Microsoft Visual C++ (MSVC) is a compiler for the C, C++, C++/CLI and C++/CX programming languages by Microsoft. MSVC is proprietary software; it was originally a standalone product but later became a part of Visual Studio and made available in both trialware and freeware forms. It features tools for developing and debugging C++ code, especially code written for the Windows API, DirectX and .NET.

<span class="mw-page-title-main">Visual Basic (.NET)</span> Object-oriented computer programming language

Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 February 2023, stating that VB is a stable language now and Microsoft will keep maintaining it.

C++Builder is a rapid application development (RAD) environment for developing software in the C++ programming language. Originally developed by Borland, as of 2009 it is owned by Embarcadero Technologies, a subsidiary of Idera. C++Builder can compile apps for Windows, iOS, macOS, and Android. It includes tools that allow drag-and-drop visual development, making programming easier by incorporating a WYSIWYG graphical user interface builder.

The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal.

The Object Windows Library (OWL) is a C++ object-oriented application framework designed to simplify desktop application development for Windows and OS/2.

<span class="mw-page-title-main">DirectShow</span> Microsoft API

DirectShow, codename Quartz, is a multimedia framework and API produced by Microsoft for software developers to perform various operations with media files or streams. It is the replacement for Microsoft's earlier Video for Windows technology. Based on the Microsoft Windows Component Object Model (COM) framework, DirectShow provides a common interface for media across various programming languages, and is an extensible, filter-based framework that can render or record media files on demand at the request of the user or developer. The DirectShow development tools and documentation were originally distributed as part of the DirectX SDK. Currently, they are distributed as part of the Windows SDK.

<span class="mw-page-title-main">Windows Forms</span> Graphical user interface software library

Windows Forms (WinForms) is a free and open-source graphical (GUI) class library included as a part of Microsoft .NET, .NET Framework or Mono, providing a platform to write client applications for desktop, laptop, and tablet PCs. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library, it does not offer a comparable paradigm and only acts as a platform for the user interface tier in a multi-tier solution.

The Active Template Library (ATL) is a set of template-based C++ classes developed by Microsoft, intended to simplify the programming of Component Object Model (COM) objects. The COM support in Microsoft Visual C++ allows developers to create a variety of COM objects, OLE Automation servers, and ActiveX controls. ATL includes an object wizard that sets up primary structure of the objects quickly with a minimum of hand coding. On the COM client side ATL provides smart pointers that deal with COM reference counting. The library makes heavy use of the curiously recurring template pattern.

<span class="mw-page-title-main">Microsoft Visual Studio Express</span> Integrated development environment

Microsoft Visual Studio Express was a set of integrated development environments (IDEs) that Microsoft developed and released free of charge. They are function-limited version of the non-free Visual Studio and require mandatory registration. Express editions started with Visual Studio 2005.

Windows Presentation Foundation (WPF) is a free and open-source graphical subsystem originally developed by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX and attempts to provide a consistent programming model for building applications. It separates the user interface from business logic, and resembles similar XML-oriented object models, such as those implemented in XUL and SVG.

Windows Template Library (WTL) is a free software, object-oriented C++ template library for Win32 development. WTL was created by Microsoft employee Nenad Stefanovic for internal use and later released as an unsupported add-on to Visual Studio and the Win32 Framework SDK. It was developed primarily as a light-weight alternative to the Microsoft Foundation Classes and builds upon Microsoft's ATL, another lightweight API widely used to create COM and ActiveX libraries.

In Microsoft Windows applications programming, OLE Automation is an inter-process communication mechanism created by Microsoft. It is based on a subset of Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement the IDispatch interface. It provides an infrastructure whereby applications called automation controllers can access and manipulate shared automation objects that are exported by other applications. It supersedes Dynamic Data Exchange (DDE), an older mechanism for applications to control one another. As with DDE, in OLE Automation the automation controller is the "client" and the application exporting the automation objects is the "server".

Borland C++ was a C and C++ IDE released by Borland for MS-DOS and Microsoft Windows. It was the successor to Turbo C++ and included a better debugger, the Turbo Debugger, which was written in protected mode DOS.

The Microsoft Windows operating system supports a form of shared libraries known as "dynamic-link libraries", which are code libraries that can be used by multiple processes while only one copy is loaded into memory. This article provides an overview of the core libraries that are included with every modern Windows installation, on top of which most Windows applications are built.

Visual Studio Tools for Office (VSTO) is a set of development tools available in the form of a Visual Studio add-in and a runtime that allows Microsoft Office 2003 and later versions of Office applications to host the .NET Framework Common Language Runtime (CLR) to expose their functionality via .NET.

<span class="mw-page-title-main">Visual Studio</span> Code editor and IDE

Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms including Windows API, Windows Forms, Windows Presentation Foundation (WPF), Windows Store and Microsoft Silverlight. It can produce both native code and managed code.

Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in Windows 8 and Windows Server 2012 in 2012. It is implemented in C++ and officially supports development in C++, Rust/WinRT, Python/WinRT, JavaScript-TypeScript, and the managed code languages C# and Visual Basic (.NET) (VB.NET).

References

  1. "Visual Studio 2019 Release Notes". Msdn.microsoft.com. Retrieved July 24, 2019.
  2. Visual C++ Express Overview
  3. "Visual C++ 2008 Feature Pack shipped". Blogs.msdn.com. Retrieved April 26, 2008.
  4. 1 2 "Quick Tour of New MFC functionality". Blogs.msdn.com. Retrieved September 10, 2019.
  5. "Visual Studio Express Edition FAQ". Microsoft.com. Archived from the original on June 11, 2011. Retrieved January 6, 2012.
  6. "Microsoft Buys Into Inprise, Settles Disputes". Techweb.com. Archived from the original on October 17, 2007. Retrieved January 6, 2012.
  7. Williams, Mickey; David Bennett. "Creating Your Own Message Maps". Inform IT.
  8. "MFC Update Powered By BCGSoft". Msdn2.microsoft.com. Retrieved November 16, 2007.
  9. "Visual C++ 2008 Feature Pack Release Download Page". Microsoft.com. Retrieved May 16, 2008.
  10. 1 2 3 4 5 6 7 "MS11-025: Vulnerability in Microsoft Foundation Class (MFC) Library could allow remote code execution: April 12, 2011". Microsoft.com. Retrieved June 10, 2019.
  11. 1 2 3 "Microsoft Security Bulletin MS09-035 - Moderate: Vulnerabilities in Visual Studio Active Template Library Could Allow Remote Code Execution (969706)". Microsoft.com. Retrieved November 19, 2012.
  12. 1 2 3 "Protect your computer from the Active Template Library (ATL) security vulnerability". Archived from the original on October 26, 2010. Retrieved October 29, 2010.
  13. "Microsoft Visual Studio 2005 Service Pack 1 MFC Security Update". Microsoft.com. Retrieved November 19, 2012.
  14. "Where can I download Visual C++ Redistributables?" . Retrieved June 10, 2019.
  15. "FIX: "HRESULT: 0x80073715" error when you install an application by using an .msi file if the file is merged with merge modules for the Visual C++ 2005 runtime library". Microsoft.com. January 25, 2021.
  16. 1 2 vcredist/source_links/README.md > Source Links Archive
  17. "Visual C++ - Exploring New C++ and MFC Features in Visual Studio 2010". Msdn.microsoft.com. Retrieved November 19, 2012.
  18. "Update for Visual C++ 2013 and Visual C++ Redistributable Package". Msdn.microsoft.com. Retrieved January 8, 2017.
  19. "Update for Visual C++ 2013 and Visual C++ Redistributable Package". Msdn.microsoft.com. Retrieved January 8, 2017.
  20. "Update for Visual C++ 2013 Redistributable Package" . Retrieved June 10, 2019.
  21. "Visual Studio 2015 Update 1". Msdn.microsoft.com. Retrieved June 12, 2016.
  22. "Visual Studio 2015 Update 2". Msdn.microsoft.com. Retrieved June 12, 2016.
  23. "Visual Studio 2015 Update 3". Msdn.microsoft.com. Retrieved June 28, 2016.
  24. "Microsoft Visual Studio 2015 Update 3 (KB3165756)". Msdn.microsoft.com. Retrieved August 28, 2016.
  25. C++ binary compatibility between Visual Studio versions

Further reading