- Microsoft Foundation Class Library
-
Microsoft Foundation Class Library Developer(s) Microsoft Initial release 1992 Stable release 10.0.40219.1 [1] [2] [3] / March 3, 2010 (RTW) [1] [3] [2] Written in C++ Operating system Microsoft Windows Type Development library License Proprietary Website MFC reference The Microsoft Foundation Class Library (also Microsoft Foundation Classes or 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.
Contents
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 MFC classes and call member functions belonging to those objects. Many of those functions share their names with corresponding API functions.[4]
One interesting 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. MFC is not included in the free edition of Visual C++ 2005/2008/2010 Express.[5]
The 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 VCL (Visual Component Library) to replace the OWL framework.
Microsoft's emphasis on MFC has been reduced in favor of its .NET Framework. MFC 7, 8 and 9 bridge elements of MFC with the .NET Framework to aid developers in migrating to the new framework. The MSVC++ compiler backend can emit managed and native object file(s). The linker can then build them together, generating mixed (both managed and native) applications, allowing existing native applications to use managed extensions in a seamless manner. Though Microsoft has de-emphasized MFC, it remains a popular and widely used framework.
A lightweight alternative to MFC is the Windows Template Library (WTL). C++ Express version compiles WTL applications (if you have ATL installed), but does not include the IDE support of the Standard, Professional and Team editions.
Features
At the time of its introduction, MFC provided C++ macros for Windows message-handling (via Message Maps), 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.
Visual C++ 2008 Feature Pack
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.[7] The update features new user interface constructs, including the Ribbon user interface of Microsoft Office 2007 and associated UI widgets, fully customizable toolbars, docking panes like Visual Studio 2005 (which can either be freely floated or docked to any side) and document tabs.[8] 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 in Microsoft Office 2007. 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 Visual Studio 2005 user interface elements. The new functionality is provided in new classes so that old applications still continue to run.[8] This update is building on top of BCGSoft’s BCGControlBar Library Professional Edition.[9]
Microsoft has also imposed additional licensing requirements on users of the Ribbon UI.[10] These include a requirement to adhere to Microsoft UI Design Guidelines, and a prohibition against using such a UI in applications which compete with Microsoft Office applications.
Versions
Product version MFC version Year introduced Microsoft C/C++ 7.0 MFC 1.0 1993 Visual C++ 1.0 MFC 2.0 Visual C++ 1.5 MFC 2.5 Visual C++ 1.51 MFC 2.51 Visual C++ 1.52c MFC 2.5 (Last development platform for Windows 3.x) Visual C++ 2.0 MFC 3.0 Visual C++ 2.1 MFC 3.1 Visual C++ 2.2 MFC 3.2 Visual C++ 4.0 MFC 4.0 (mfc40.dll included with Windows 95) Aug 1995 Visual C++ 4.1 MFC 4.1 Visual C++ 4.2 MFC 4.2 (mfc42.dll included with the Windows 98 original release) Mar 1998 eMbedded Visual C++ 3.0 MFC 4.2 (mfc42.dll) Visual C++ 5.0 MFC 4.21 (mfc42.dll), a major upgrade from MFC 4.2. Visual C++ 6.0 MFC 6.0 (mfc42.dll) 1998 eMbedded Visual C++ 4.0 MFC 6.0 (mfcce400.dll) Visual C++ .NET 2002 (Visual C++ 7.0), .NET 1.0 MFC 7.0 (mfc70.dll) Feb 2002 Visual C++ .NET 2003 (Visual C++ 7.1), .NET 1.1 MFC 7.1 (mfc71.dll) Apr 2003 Visual C++ .NET 2003 + MS11-025[11] MFC 7.10.6119.0 (mfc71.dll) Apr 2011 Visual C++ 20051 (Visual C++ 8.0), .NET 2.0 MFC 8.0.50608.0 (mfc80.dll) Oct 2005 Visual C++ 2005 SP1 MFC 8.0.50727.762 (mfc80.dll) Visual C++ 2005 SP1 + MS09-035[12][13] MFC 8.0.50727.4053 (mfc80.dll) Jul 2009 Visual C++ 2005 SP1 + MS11-025[14] MFC 8.0.50727.5592(mfc80.dll) Apr 2011 Visual C++ 20081 (Visual C++ 9.0), .NET 3.5 MFC 9.0.21022.8 (mfc90.dll) Nov 2007 Visual C++ 2008 with Feature Pack MFC 9.0.30411 (mfc90.dll) Apr 2008 Visual C++ 2008 SP1 MFC 9.0.30729.1 (mfc90.dll) Aug 2008 Visual C++ 2008 SP1 + MS09-035[15][16] MFC 9.0.30729.4148 (mfc90.dll) Jul 2009 Visual C++ 2008 SP1 + MS11-025[17] MFC 9.0.30729.5570 (mfc90.dll) Apr 2011 Visual C++ 2010, .NET 4.0 MFC 10.0.30319.1 (mfc100.dll) Apr 2010 [18] Visual C++ 2010 + MS11-025[19] MFC 10.00.30319.415 (mfc100.dll) Apr 2011 Visual C++ 2010 SP1 MFC 10.0.40219.1 (mfc100.dll) March 2011 - 1 The Visual Studio Express Editions do not include the MFC libraries.
References
- ^ a b Microsoft Visual Studio 2010 Service Pack 1
- ^ a b Microsoft Visual C++ 2010 Redistributable Package (x64)
- ^ a b Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)
- ^ Visual C++ Express Overview[dead link]
- ^ Visual Studio Express Edition FAQ
- ^ Microsoft Buys Into Inprise, Settles Disputes
- ^ "Visual C++ 2008 Feature Pack shipped". http://blogs.msdn.com/somasegar/archive/2008/04/07/visual-c-2008-feature-pack-shipped.aspx. Retrieved 2008-04-26.
- ^ a b "Quick Tour of New MFC functionality". http://blogs.msdn.com/vcblog/archive/2007/11/09/quick-tour-of-new-mfc-functionality.aspx. Retrieved 2007-11-16.
- ^ "MFC Update Powered By BCGSoft". http://msdn2.microsoft.com/en-us/visualc/bb892882.aspx. Retrieved 2007-11-16.
- ^ "Visual C++ 2008 Feature Pack Release Download Page". http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en#Instructions. Retrieved 2008-05-16.
- ^ http://www.microsoft.com/technet/security/bulletin/MS11-025.mspx
- ^ http://www.microsoft.com/technet/security/bulletin/ms09-035.mspx
- ^ http://www.microsoft.com/security/atl.aspx
- ^ http://www.microsoft.com/technet/security/bulletin/MS11-025.mspx
- ^ http://www.microsoft.com/technet/security/bulletin/ms09-035.mspx
- ^ http://www.microsoft.com/security/atl.aspx
- ^ http://www.microsoft.com/technet/security/bulletin/MS11-025.mspx
- ^ http://msdn.microsoft.com/en-us/magazine/ee336130.aspx
- ^ http://www.microsoft.com/technet/security/bulletin/MS11-025.mspx
Further reading
- Prosise, Jeff (1999). Programming Windows with MFC. Microsoft Press. ISBN 1-57231-695-0.
- Shepherd, George (1996). MFC Internals. Addison-Wesley. ISBN 0-201-40721-3.
- Kruglinski, David (1996). Inside Visual C++. Microsoft Press. ISBN 0-55615-891-2.
- Microsoft Corporation (1995). Microsoft Visual C++ Programming with MFC. Microsoft Press. ISBN 1-55615-921-8.
External links
- MSDN MFC Reference
- MSDN MFC newsgroup
- MFC: Visual Studio 2005 and Beyond
- An Inside Look At The Next Generation Of Visual C++ (covers the major MFC 9 updates)
Microsoft APIs and frameworks Graphics Audio Multimedia Web Data access Networking Communication Administration and
managementComponent model Libraries Base Class Library (BCL) · Microsoft Foundation Classes (MFC) · Active Template Library (ATL) · Windows Template Library (WTL)Device drivers Windows Driver Model · Windows Driver Foundation (KMDF · UMDF) · WDDM · NDIS · UAA · Broadcast Driver Architecture · VxDSecurity .NET Software factories IPC Accessibility Text and multilingual
supportList of widget toolkits Low-level High-level On Amiga OSOn WindowsMicrosoft Foundation Class Library · Windows Template Library · SmartWin++ · Object Windows Library · Visual Component Library · Windows Forms · Windows Presentation Foundation · SilverlightOn Unix,
under X11Cross-platform,
by languageAdobe Flex · AsWingXMLAmple SDK · CougarXML · GladeXML · Lively Kernel · Pyjamas · Rialto Toolkit · XAML · XML User Interface · XUL · WtdesktopwebGoogle Web Toolkit · ExtJS GWTC or C++CEGUI · Component Library for Cross Platform · FLTK · FOX toolkit · OpenGL User Interface Library · GTK+ · Juce · JX Application Framework · Qt · Wt · Tk · TnFOX · Visual Component Framework · wxWidgets · YAAF · XForms · XVT · Ultimate++Common LispObject PascalQtRubyCategories:- C++ libraries
- Application programming interfaces
- Microsoft application programming interfaces
- Widget toolkits
Wikimedia Foundation. 2010.