Get a feel for the new MFC features using samples

Get a feel for the new MFC features using samples

  • Comments 19

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

  • Hello,

    Where do we find the samples. They are not installed with the MFC Feature pack

  • Hello Nick,

    As Jessica indicated you can find the samples as part of the VC samples zip file installed on your machine. For example, on my machine the zip file is at C:\Program Files\Microsoft Visual Studio 9.0\Samples\1033\ Unzip that file and then go to C++\MFC . You will then find a directory called "Visual C++ 2008 Feature Pack". You should find the samples there.

    Hope this helps!


    Ayman Shoukry

  • Awesome! Are there any samples showing the TR1 features you have added (like smart_pointers etc).


  • I installed the beta feature pack. Without uninstallation I installed the first release of the feature pack but the sample zip stayed unchanged. For the refresh I uninstalled the release version, renamed the sample zip which wasn't removed. After installing the refresh I still have not got the new sample zip.

    How do I get the new samples zip?



  • WTF is an 'SDET'? Please MS bloggers, do not assume that your MS-vocabulary is universal - on the contrary, MS seems to make up the strangest abbreviations that outsiders have no way of understanding :(

  • Yeah, I'm pretty good with Microserf-speak, but 'SDET' is a new one on me. Opaque language aside, please more articles on the new MFC stuff. Is there any chance we might see some Form Editor support for these controls? In particular the Ribbon - writing code is not a very 'designer friendly' medium (we *don't* let developers create our UI's...)

  • Great job

    Now fix intellisense and finish getting compliant with the standard and get up to c99.

  • Somewhat OT, but since you're a SDET, can you explain how on Earth did you manage to get into that mess:

    Were there any deployment tests at all?

  • Which is the best forum/newsgroup to ask questions about using these new classes?

  • I love the new 'tiny' style demonstrated in the screenshots of the sample apps :)

  • Yeah, the screenshots in this blog entry are way too small. Even when you click then, they don't link to a bigger image. Any smaller and they'd have been mistaken for icons :-)

  • It is interesting the MS would provide us an example of a editor application like Word 2007 when the agreement prevents us from making applications that use the Ribbon feel in similar applications.  Otherwise, good work.  It's good to see MFC modernized.

  • Searching the web I found that SDET = Software Design Engineer in Test

  • > Thursday, April 24, 2008 9:54 AM by commenter

    > # re: Get a feel for the new MFC features using samples

    > I love the new 'tiny' style demonstrated in the screenshots of the sample apps :)

    Sorry about that, it should be fixed now.



  • [Kris]

    > Are there any samples showing the TR1 features you

    > have added (like smart_pointers etc).

    No - we felt that it was less critical to provide TR1 samples. Books about TR1 are already available (e.g. The C++ Standard Library Extensions: A Tutorial And Reference by Pete Becker).

    My TR1 slide decks ( contain many small examples of shared_ptr, regex, and mem_fn()/bind()/function use. (All of the examples are real, not pseudocode, and have been actually compiled with VC9 TR1 - in fact, I found several bugs in TR1 (since fixed) while writing them. The only things that I elided were #include directives and the occasional int main() { }, due to space considerations on the slides.)

    Stephan T. Lavavej, Visual C++ Libraries Developer

Page 1 of 2 (19 items) 12