Get a feel for the new MFC features using samples

Hello, everyone. This is Jessica Liu. I’m an SDET on the VC Libraries team. During the past few months, I have spent most of my working hours on testing the new MFC components.

Now the Visual C++ 2008 Feature Pack has been released. This update is not going to cost you one cent if you already have Visual Studio 2008 RTM installed. But porting your application to using those new features might be a big deal to you and your products.

Want to see what those features look like before get your hands dirty?

The new MFC samples are just for you.

There are a total of 34 samples, and they cover a pretty high percentage of new MFC code. Of these new samples, I would like to highlight the following:



The MSOffice2007Demo sample demonstrates how to implement an editor application similar to an Office 2007 application, with similar user interface elements and limited similar capabilities. The MSOffice2007Demo sample implements a very full ribbon user interface much like an Office 2007 application, and some (but not all) of the ribbon elements are connected to capabilities in the application.



The VisualStudioDemo sample demonstrates how to implement an application similar to the Visual Studio IDE. The VisualStudioDemo has specific features including customizable toolbars and menus, auto-hide docking bars, MDI tabbed groups , property list control, toolbox control, toolbar combo box and edit, controls, switching between visual themes at runtime and much more…



The OutlookDemo sample demonstrates how to create an application similar to Microsoft Outlook 2003/2007. You can change the current visual theme using the Application Look dialog, which can be opened from the View | Application Look… menu. Note the Outlook Bar Office 2003 style check box. This option allows you to switch between different modes of navigation pane (also known as the outlook bar), which is docked at the left side of application window. Click the “New” toolbar button to open a mail frame. This window emulates a form used in Microsoft Outlook to compose email messages.



The NewControls sample demonstrates the capabilities of many of the controls implemented in MFC, including customizable buttons, color picker controls and palettes, a font chooser, an image editor, a property grid, a masked edit control, and shell list and tree controls.



The DrawClient sample demonstrates how to integrate support for a ribbon into an object-oriented drawing application with visual editing container support. The DrawClient sample is an update to the DrawCli MFC sample, using the same underlying document/view architecture, but with a ribbon UI instead of a toolbar. The DrawClient sample also demonstrates “command previewing”, where the effect of a command can be seen before it is actually selected, as in Office 2007.

To get these samples and instructions for installing them:

• On the Visual Studio Help menu, click Samples.

For more information, see Locating Sample Files.

• You can also locate samples on your computer’s hard disk. By default, samples and a Readme file are copied into a folder under \Program Files\Visual Studio 9.0\Samples\.

Installation of the Visual C++ 2008 Feature Pack will by default add a new folder called “Visual C++ 2008 Feature Pack” under the VC++ samples package ALLVCLanguageSamples\C++\MFC. You may want to choose another location, perhaps next to your Projects folder under your Visual Studio 2008 folder, to make the samples easier to find.

Enjoy all these tremendous new samples!


Jessica Liu
Visual C++ Libraries Team