Home > CodeProject > Visual C++ 2010: What’s new for MFC library?

Visual C++ 2010: What’s new for MFC library?

Some years ago I thought that MFC will be obsolete, and no new features will be added, but I was wrong, VS2008 added many features and enhancements, and with VS 2010 I discovered new improvements.

So what’s new in MFC 10? to answer to this question I tried to compare the two versions MFC 9 and MFC 10 using CppDepend.

Removed classes:

Let’s begin with breaking changes and search for removed classes:


It was very strange that this class is removed , and to be sure I searched in the code source and I found it inside #ifdef ENABLE_RIBBON_LAUNCH_BUTTON statement.

The only resource I found in the web talking about this change is here , and I dont know if
adding #define ENABLE_RIBBON_LAUNCH_BUTTON is suficient to compile without problem.

Added Classes:


What’s the new features added by these classes?

When I searched in MSDN the utility of these classes , I didnt found any useful informations, so I searched for methods using CMFCRibbonInfo.


The RibbonBar class use CMFCRibbonInfo to save it to xml or load it.

Jump list is a new useful Window7 feature, it adds a new way of interaction between user and application.
here’s a good article to add JumpList feature with MFC.


This class provides a CWnd support for MFC Control containment of Feature Pack controls.

And to know which controls can be contained inside this container, let’s search for classes used by CMFCControlContainer::CreateDlgControl.

Here’s the result:

So only these MFC feature pack controls are concerned by this container.


This class implements ATL::IDocument interface required for “Search and Organize” feature.
My first impression when I discovered this implemention was ” WOW, MFC use now interfaces to enforce low coupling”.

Let’s see the impact of using this interface, for that let’s search for classes using CDocumentAdapter :

SELECT TYPES WHERE IsDirectlyUsing “CDocument+CDocumentAdapter

Only CDocument use directly this class.

However IDocument is used by other classes like the new class CMFCPreviewCtrlImpl, so this class can work with CDocumentAdapter and also others classes implementing this interface.

And as explained in the comment of CDocumentAdapter code source:

“Search and Organize handlers are implemented in ATL DLLs, which can be MFC or not-MFC based.Internally handlers refer to IDocument interface, whose implementation in the common case should be supplied by a developer. CDocumentAdapter provides this implementation for MFC and basically calls the appropriate methods of the parent CDocument.”

This class autosaves documents and restores them if an application unexpectedly exits, it’s used by Restart Manager feature, here’s an interesting article talking about it.

Let’s search for classes used by CDataRecoveryHandler:

SELECT TYPES WHERE IsDirectlyUsedBy “CDataRecoveryHandler

CDataRecoveryHandler is highly coupled with other MFC classes like CDocument, CWinApp, CWnd.

Which MFC classes use the recovery feature?

SELECT TYPES WHERE IsDirectlyUsing “CDataRecoveryHandler

So all these classes benefit of this new feature especially CDocument.

A pop-up dialog box that functions like a message box but can display additional information to the user.
here’s an interesting article talking about this feature.

Gives an application the apparence of a VS2008 or Windows 7 application.

Used for touch feature.

CFolderPickerDialog class implements CFileDialog in the folder picker mode.

when I dsicovered these classes, I thought that is concerning xml parsing but when I searched for methods using them, I discovered that only CMFCRibbonInfo use them to save or load its description to xml files.


CMFCZoomKernel,CMFCScanliner, CMFCScanlinerBitmap :
Not yet documented in MSDN, let’s discover which classes use them.

SELECT TYPES WHERE IsDirectlyUsing “CMFCZoomKernel

And we have the same result for the two other classes.

Methods Removed:


Almost all these methodes are not removed but only the signature is changed , and some optional parameters are added, however some methods are removed like CCommandManager::ResetAllImages or CPanelDialog::ClipPaint, and one method was renamed from CMFCRibbonBar::GetTabTrancateRatio to CMFCRibbonBar::GetTabTruncateRatio.

Methods Added:

Let’s search for all methods added to MFC10


Which features are added by these new methods?

For that we will focus only in the most used classes.


Here’s the methods added for CWnd, and almost all methods added concern touch feature and touch gestures.

Many methods of these classes add CAtlTransactionmanager as optional parameter.

Transactional File System is a new technology first introduced in Windows Vista. It enables you to roll back operations made on the file system and registry.

here’s a good article about this feature.


New possibilities to add item to recent file list are now available.

Here’s the methods added by CDocument:

Two new features concern methods added :

-Supporting Windows Search with MFC
-Rich Preview

Let’s discover the changes concerning dependency of CDocument to other MFC classes,and which additional dependencies are added in MFC10, for that Dependency Matrix can be useful, and the sign “+” in the cell representing the dependency indicate that this dependency is new.

So many dependencies are added, especially with new classes added to MFC10 like CDataRecoveryHandler,and also some other inner classes added to CDocument.

Here’s the methods added by CFileDialog:

A good news is we can now customize CFileDialog by adding what we want in the dialog.

Here’s the methods added by CMDIChildWndEx:

Windows7 add a new interesting features like:taskbar Tabs,Taskbar thumbnails and thumbnail previews, and almost all methods added to CMDIChildWndEx concern these features.


Windows 7 add also some useful features like OverlayIcon and progressbar in the taskbar, and the methods added to CFrameWnd concern these features.


Almost all methods added to CWinApp concern the ApplicationRecovery support.

Other useful methods are added like CMFCControlRenderer::SmoothResize and CDrawingmanager::DrawRotated.

Methods where visibility was changed:


Almost the visibility of all CMFCRibbonTab methods is changed from private to public.

But when I checked the code source the only modification in the class declaration is the adding of DECLARE_DYNAMIC(CMFCRibbonTab) , this macro include “public:” , so I wonder if this visibility changes is only a side effect of adding this macro.

Methods Not Used Anymore:

Some methods become obsolete when upgrading framework version, did MFC10 not use anymore some methods?

To answer to this question let’s execute the query :


here’s the result:

These methods were declared before in multimon.h , the origin of this file goes back to Windows 98 to let compatibility with Windows 95 in the case of multi monitor, here’s an interesting article talking about it.
In MFC10 this file is no longer included in mfc files. and MFC10 use directly GetSystemMetrics instead of xGetSystemMetrics.

About these ads
Categories: CodeProject
  1. September 7, 2010 at 6:10 am | #1

    Thank! Great and very interesting article.

  2. John Schroedl
    February 14, 2011 at 2:09 pm | #2


  3. Crow
    March 30, 2011 at 7:39 am | #3

    Crap, MS abandoned MFC!

    What’s the point to use MFC nowadays if we have VCL from BC++, QT++ or C#, where both of them have NICE UI editors! And Visual C++? It’s still primitive and consumes lots of time and it’s horrible to play with (UI editor).

    I thought MFC in VS2010 would have excelent improvement but I’m disapointed.

    • March 30, 2011 at 9:40 am | #4

      Sure there are many other librairies better than MFC , but many companies have a huge projects using MFC and they cant migrate easily to other librarires, and they need some features for their evolutions.and the goal of this article is not to proof that MFC is the best but only to shows the MFC new features.
      And in previous post Inside MFC i talk about some MFC problems.

  1. September 3, 2010 at 5:59 am | #1
  2. September 3, 2010 at 6:15 am | #2
  3. September 3, 2010 at 6:29 am | #3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: