Welcome to MSDN Blogs Sign in | Join | Help

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:

MSOffice2007Demo

clip_image002

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.

VisualStudioDemo

clip_image004

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…

OutlookDemo

clip_image006

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.

NewControls

clip_image008

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.

DrawClient

clip_image010

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!

Thanks,

Jessica Liu
Visual C++ Libraries Team

Published Wednesday, April 23, 2008 1:37 PM by vcblog

Comments

Wednesday, April 23, 2008 10:03 PM by Nick White

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

Hello,

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

Wednesday, April 23, 2008 10:10 PM by Ayman Shoukry

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

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\AllVCLanguageSamples.zip. 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!

Thanks,

Ayman Shoukry

Thursday, April 24, 2008 12:56 AM by Kris

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

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

Thanks.

Thursday, April 24, 2008 3:12 AM by SvenC

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

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?

--

SvenC

Thursday, April 24, 2008 3:20 AM by Joske Vermeulen

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

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 :(

Thursday, April 24, 2008 4:53 AM by Tom Kirby-Green

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

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...)

Thursday, April 24, 2008 5:17 AM by Anito Admito

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

Great job

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

Thursday, April 24, 2008 6:18 AM by pingpong

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

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

http://blogs.msdn.com/vcblog/archive/2008/04/12/visual-c-2008-feature-pack-setup-deployment-issues.aspx

Were there any deployment tests at all?

Thursday, April 24, 2008 7:15 AM by Antony

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

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

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 :)

Thursday, April 24, 2008 10:08 AM by Nish

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

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 :-)

Thursday, April 24, 2008 12:02 PM by Shawn B.

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

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.

Thursday, April 24, 2008 3:12 PM by Chrs

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

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

Monday, April 28, 2008 4:09 PM by vcblog

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

> 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.

Thanks

Damien

Monday, April 28, 2008 5:04 PM by Stephan T. Lavavej [MSFT]

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

[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 (http://blogs.msdn.com/vcblog/archive/2008/02/22/tr1-slide-decks.aspx) 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

Friday, May 02, 2008 1:43 AM by YD Kim

# I find a bug in MSOffice2007Demo Sample

I find a bug in MSOffice2007Demo Sample.

Please Check dump file.

Memory Dump : http://www.insidewindows.kr/wp-content/uploads/2008/05/msoffice2008demo.zip

Dump Analysis : http://www.insidewindows.kr/?p=53

Tuesday, May 06, 2008 4:29 PM by vcblog

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

Hello YD Kim

> Friday, May 02, 2008 1:43 AM by YD Kim

> # I find a bug in MSOffice2007Demo Sample

If you find a bug in MFC (or VC++ or any other MS product) please submit it at the Connect website: http://www.connect.microsoft.com/

Thanks

Damien

Tuesday, May 20, 2008 4:50 PM by DevExpress

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

Friday, May 23, 2008 3:28 AM by jamal

# flicker in MSMoneyDemo sample

I tried some sample included in VC++ feature pack,  but I found some sample have annoying flicker during startup. Try MsMoneydemo for instance. Does this because of the quality of the library itself (which I read from other post, some people dislike BCG because of this) or just the sample use the library wrong way?

New Comments to this post are disabled
 
Page view tracker