Welcome to MSDN Blogs Sign in | Join | Help

Quick Tour Of New MFC Functionality

Hi I’m Pat Brenner, a developer on the Visual C++ libraries team.  I’m pleased to give you a sneak peek at a major MFC update we’ve been working on.  Since we’re adding a number of cool new user interface components to MFC, this blog post is going to be graphics heavy.  I’d much rather show you some of these components than just describe them!  I hope you enjoy this quick tour through the new portions of the library.

 

Modern user interface elements

 

This update to the MFC library will enable developers to build modern user interfaces with support for the Office 2007 Ribbon Bar, Office-style menus, Visual Studio-style docking toolbars, tabbed documents and much more.   All of the components included in the update will run on Windows 2000 and above.

 

Let’s take a look at some of the Office 2007 Ribbon Bar support.  Below is an image of an MFC application built with the Office look and feel:

 

 Ribbon Application

The ribbon support includes support for the application button (the large round button at the top left), the quick access toolbar (the small set of tools just to the right of the application button) and the standard ribbon components.  Each tab on the ribbon (e.g., the “Home” tab above) allows access to a category of tools.  Each category is divided up into a set of panels (e.g., “Clipboard” and “Font” above) and each panel contains a set of ribbon elements.  These ribbon elements can have a wide variety of styles—I’ll go into more detail about these later.

 

Perhaps many of you would like to build applications that utilize some of the functionality we’ve had in Visual Studio.  For example, one of the most requested features is support for the smart docking we added in Visual Studio 2005.  With this new release, all the cool user interface features you’ve seen in the past versions of Visual Studio are at your disposal.

 

Let’s take a look at some of the Visual Studio support.  Below is an image of an MFC application built with the Visual Studio look and feel:

VS2005 Docking (edit)

 

MFC now implements its own menu bar and toolbar, which is fully customizable like the Visual Studio toolbar and menu bar.  This means that buttons can be moved between toolbars, and even from the toolbar to the menu bar and vice versa.   Custom toolbars can be created, and commands can be added to them.  And the images for the individual toolbar buttons can even be changed, and custom images can be created and used.  Support for docking panes is also included—these panes can be grouped into one docking frame as above, they can be floating as well as docked, and they support auto-hide mode like in Visual Studio, so a docked pane will slide out from the edge of the frame when its tab is hovered over, mimicking the Visual Studio behavior.  There is also support for tabbed MDI documents (which can be grouped) like in Visual Studio.

                                                                                                                                                                                                                                                        

Ribbon Elements

 

In addition to all the features supporting Office, Internet Explorer and Visual Studio “look and feel” there are a number of built-in cool elements you can use in the ribbon in your application.  In the images below, we provide a quick visual introduction to what’s included in the library.  The images come from the RibbonGadgets example that ships with the library.

 

In the image below you can see large and small buttons, as well as check boxes.  The buttons can be simple (so they just respond to a click), or they can drop down a menu or be a split button which responds to the click or drops a menu depending on the click location.

RibbonGadgets 1 (edit) 

In the image below you can see what we call palette buttons.  These can be a set of buttons that have associated images, so the user can see what he will get when he clicks on a button in the palette.  These palettes can be embedded in the ribbon, or they can be dropped down from a button in a window which can be resized dynamically by the user.

 RibbonGadgets 2 (edit)

In the image below you can see a variety of color choosers.  These can be embedded in the ribbon, or they can be attached to a button.  The table of colors associated with the chooser can be customized in your application.  There is a color picker dialog which offers even more flexibility, including the ability to choose the color of any pixel on the screen and use that color.

RibbonGadgets 3 (edit)

In the image below you can see groups of commands.  A ribbon group can be built from an existing toolbar, so if your application has a large number of toolbars, you can place them on the ribbon with ease.

                           

RibbonGadgets 4 (edit)                         

In the image below you can see support for edit boxes, combo boxes and spin controls, as well as the font picker control, which can display the font names in the font (as in Word) so you get an instant preview of the font appearance.

RibbonGadgets 5 (edit) 

Below you can see a few more ribbon elements.  Several of these, including the progress indicators and the links and sliders, actually make more sense on the ribbon status bar, which you can see in the first image at the top of this article.

                 

RibbonGadgets 6 (edit)                                                         

Powerful application wizard

 

We’ve also beefed up the MFC Application Wizard (see the images below) quite a bit to enable easy use of these new features in MFC.  We’ve added a couple of options to the “Project Style” category which will allow you to build a project that looks something like Visual Studio or an Office application by default.  We’ve added the option to use tabbed MDI document windows rather than the old MDI style.  And we’ve added the ability to choose the look and feel of your application with the “Visual Style and Colors” combo box.

 

An option that is hidden in this image is a checkbox that allows your application look and color to be changed at runtime.  You can choose your application look and color at design time, but if the user wants to change it, he can do so easily.  This is possible because the drawing of all the user interface elements is done via what is called a “visual manager”.  The visual manager takes care of all the drawing of elements, so if a different look is desired, all that is required is to switch to a different visual manager, and redraw the window, and your application instantly has a completely new look.  As you can see in the image below,  a number of schemes are supported, including Office 2003, Visual Studio 2005, and several different Office 2007 schemes which use different colors.  All of these are implemented using visual managers.

 

 wizard1

An option that is disabled in the image below (because ribbon was chosen instead of menu bar) is a checkbox that enabled “personalized menu behavior”.  This means that the menus will not show all commands by default, just like in Office applications.  When a menu is hovered over briefly, the menu will expand to contain its full set of commands.  And as the application is used, the most-used commands are added to the menu by default, so over time, the menu will become personalized to how it is being used.

 

 wizard2

 

Below is a screenshot of a running application which uses a ribbon.  This is actually the application created by the Application Wizard when the “Office” project style is chosen.  There is an Outlook-style navigation bar docked on the left side of the frame, and a caption (or message) bar at the top of the client area.  Note that the application button, quick access toolbar buttons, and the ribbon elements have keyboard hotkeys which are available when the Alt key is pressed.  On the right hand side of the ribbon is a drop-down element named “Style”, and from it you can choose which color you’d like the application to be presented in.

Wizard Generated with accelerator tips

Easy to update existing MFC code

 

One of the great things about the new components is that they’re easy to incorporate into existing applications.  All of the new behavior is encapsulated in new classes, and none of the existing classes have been modified.  If you want to update your existing MFC application to use the new menu bar and toolbar support, all that is required to update your application to the new look is to change the base classes of your application and frame windows, and add a few lines of code, and you’ve just updated your application to have a more modern interface. 

 

Below is an image of the new DrawClient sample.  This is a remodel of the DrawCli sample that ships with MFC—it’s been updated to include Ribbon support.  Most of the modifications to the source code were in mainfrm.h and mainfrm.cpp.  The ribbon is currently built entirely in code.  The ribbon is created and then the various ribbon elements (application button, quick access toolbar, categories, etc.) are added via calls to ribbon member functions.  However, the underlying command architecture did not have to change—all the ribbon controls can be associated with a command identifier, and when the command is fired, it is handled via the existing command handlers.  The object drawing code did not have to change in any substantial way—it was only augmented to allow a few new capabilities.  One of these capabilities is something I’ll call “command preview”.  This means that, just like in the new Office applications, you can see the effect of a command before actually choosing it.  For example, the purple rounded rectangle is active below.  As you float the mouse over the large color buttons in the ribbon, the rectangle will temporarily change color to match the color of the button the mouse is hovered over.  When you click on the button, the color of the rectangle will then be changed.

 

 drawcli (edit)

We’re pretty excited about all these new additions to MFC, and we hope you are too!  Feel free to ask any questions you have about the new features and I’ll do my best to answer.

 

Pat Brenner

Visual C++ Libraries Development 

Published Friday, November 09, 2007 2:12 PM by vcblog

Comments

Friday, November 09, 2007 5:43 PM by Andre

# re: Quick Tour Of New MFC Functionality

Blah blah blah. Anything new which can't be found here?

http://www.bcgsoft.com/FeatureTour/bcgcontrolbar-tour.htm

*thumbs down*

Friday, November 09, 2007 6:01 PM by Tony

# re: Quick Tour Of New MFC Functionality

Hi Pat,

This is great stuff... Are these examples in the SDK, or should I just figure them out all myself. Surely the application wizard doesn't just create me a VS look and feel app out of the box.?!

Wish there were more new MFC examples on CodePlex, or is that just for the managed world?

Friday, November 09, 2007 6:04 PM by WhatDoesItMatter

# re: Quick Tour Of New MFC Functionality

So you are monitoring the comments, then what the hell does it matter... you will only show what you WANT to show... Typical Microsoft filtering. Thats right, check your log files!

Friday, November 09, 2007 6:20 PM by Olivier

# re: Quick Tour Of New MFC Functionality

Outstanding!

I don't get why nice additions draw negative feelings.  That a feature exists elsewhere doesn't reduce the fact that having the feature in MFC is a net positive.  Geeks can be such curmudgeons sometimes...

Good work!

Friday, November 09, 2007 6:37 PM by Iain Heath

# re: Quick Tour Of New MFC Functionality

Pat, couple of questions about the new Office 2007 Ribbon functionality...

- Is this the actual ribbon code from Office (MSO) refactored, or is it a separate ground-up implementation?

- Will full source code be available for the new MFC, just as its has been for all prior releases of MFC?

Iain.

Friday, November 09, 2007 9:28 PM by Rodrigo Strauss

# re: Quick Tour Of New MFC Functionality

Thank you all @ VC team, thank you very much! It will really help to reassure the commitment of Microsoft to the native C++ development.

Saturday, November 10, 2007 1:39 AM by carole

# re: Quick Tour Of New MFC Functionality

To Iain:

This ribbon is not actual MSO source code; this is taken from BCGSoft.

http://www.bcgsoft.com/pressreleases/PR071110.pdf

I'm quite disappointed that ribbon and other advanced features are not from MS internal source codes, but bought from 3rd party.

We would like to use real and exactly same with MSO and VS. I'm wondering how much Visual C++ team could guarantee its quality and performance.

(I've already been using BCG library, and xTreme library...)

Saturday, November 10, 2007 3:24 AM by Sam

# re: Quick Tour Of New MFC Functionality

Hi,

carole >

I don't understand... How are built Office 2007 and VS2005 internally ? It can't be with BCG, right ? I mean... BCG provides VS-LIKE, and Office-LIKE, *after* Office and VS have been released... But the source code of VS and Office doesn't use BCG, right ?

So, I don't understand why MS doesn't use its own source code to provide these look-and-feels to programmers... Aren't VS and Office written in C++ ?

Saturday, November 10, 2007 4:01 AM by Charles L.F.

# re: Quick Tour Of New MFC Functionality

To protect something?

Anyway, it's good to have this built-in.

Saturday, November 10, 2007 5:04 AM by Manuel VN

# re: Quick Tour Of New MFC Functionality

Hi,

It is a very nice present for us, thanks. For me, most important it is knowledge than the equipment is working in MFC so that it does not disappear with the new languages and development platforms. I was working in a similar library for my applications but, with a diferent look and feel.

It is the great news, thanks.

Saturday, November 10, 2007 8:23 AM by Pavel

# re: Quick Tour Of New MFC Functionality

Hello,

this are a very great news. I was very exited to read about all this cool stuff in "next age MFC". MFC was all this time alive and i pleased to hear that Microsoft finally accepted it. 90% of our software we still developing using MFC, because of such issues like: Speed, Deployment and Compatibility. I hope this Update will give us new possibilities to pimp up our software products.  

Some questions from me:

- Is this MFC-Update only for VS2008? Are there any plans for VS2005 integration?

- What about PropertyGrid and ReportControl? Are they also a part of new MFC?

- Can you publish a new MFC class diagram?

- What about deployment issue? Is it still one DLL (mfc90.dll)?

Yaba daba du! Thanks...

Saturday, November 10, 2007 9:49 AM by Tanveer Badar

# re: Quick Tour Of New MFC Functionality

Good gracious, I can hardly wait to get my hands on it. But what about .net framework? I know you people are a separate group and Windows Forms supports interop and things

Saturday, November 10, 2007 1:52 PM by Eddie Paz

# re: Quick Tour Of New MFC Functionality

This is great. All my applications are written in MFC. I'm currently using Xtreme Toolkit, but I'm excited to have this built-in.

Can't wait to see the MFC team's implementation of BG's code.

Saturday, November 10, 2007 3:15 PM by Somebody

# re: Quick Tour Of New MFC Functionality

When I heard this functionality was going to be "built-in" to VS2008 in an update, I was *mortified*. I'd spent the last 10yrs of my life working on a GUI library. I thought that was all going to be flushed down the toilet in a single MFC update. Now that I hear that MS is really just shipping BCGSoft, I'm not too concerned. BCGSoft is one of the two biggest MFC libraries out there (CodeJock being the other), but its quality is horrible. Lots of flickering, flashing, etc. I suppose MS can take time to fix all that. I would have used CodeJock if I was them. Disclaimer: I don't work for either one, I work for my own. But between CodeJock and BCGSoft, CodeJock is definitely much higher quality.

Saturday, November 10, 2007 5:23 PM by Rick

# re: Quick Tour Of New MFC Functionality

What's the name of the library you've been working on? I'm looking for a good one, but CodeJock is too expensive (sadly, I missed sell off last month) and BCG.. ok, you said about it.

Saturday, November 10, 2007 6:48 PM by Jimmy

# re: Quick Tour Of New MFC Functionality

Pat,

A few questions:

1) Is this going to be integrated into the MFC DLLs themselves directly (horrible idea BTW since a key benefit of MFC is/was that its light weight with no dependencies), or an optional external library that I can "turn 100% off" and not add the bloat?

2) How will this affect turn around? If its an external standalone lib thats just visually integrated into the IDE, I can see it being inplace replacable when BCG comes out with fixes or new features. But if it requires a new MFC DLL, I see turn around going out the window.

Saturday, November 10, 2007 7:53 PM by Chabster

# re: Quick Tour Of New MFC Functionality

Good things:

1) modern UI for free

2) bundled into standard distribution (shared dll's)

3) attention from dev community - better docs and many examples

4) code quality improvement by MS guys (unlikely)

Bad things:

1) future MFC updates? (BCG is a commercial product and IMO it will always be more advanced)

2) MFC and new versions of BCG together?

3) BCG's code quality

Saturday, November 10, 2007 8:40 PM by Tomas

# re: Quick Tour Of New MFC Functionality

Hey Rick, don't wait for "Somebody", just download BCG's latest trial and see what stuff you're going to get for free. Don't hear what he "said about it".

Saturday, November 10, 2007 10:41 PM by Rick

# re: Quick Tour Of New MFC Functionality

I had some experience with BCGSoft products two years ago, so the first thought was that I don't need it even for free. However, I downloaded their latest pack and was amazed how the things have changed! Still there are some performance issues, but very minor. If this stuff is coming with new MFC, I take my words back!

Sunday, November 11, 2007 1:58 AM by Ayman Shoukry

# re: Quick Tour Of New MFC Functionality

Since some folks raised some issues about the quality. We haven't seen such flickering issues. From the support point of view, developers should expect the same kind of support for any other part of our librariest. We fully stand behind the quality. Hopefully you will be able to give it a try and let us know you feedback.

Thanks,

Ayman Shoukry

Lead Program Manager

Visual C++ Libraries Team

Sunday, November 11, 2007 2:35 AM by Somebody

# re: Quick Tour Of New MFC Functionality

Well, I'm not one to play QA for free :), but I'll toss you a couple of quick bones to make my point:

1) In the BCGPVisualStudioGUIDemo (as of the one posted tonight), you'll notice there are several rows of toolbars at the top:

a) Changing the height of the dock area by dragging the toolbars around causes the bottom of the application window to flash like crazy.

b) Drag one of the toolbars from docked to floating and back to docked a few times. You'll notice that even though I'm dragging it to where I want it (the lower right hand side of the dock area) it *always* flashes for a second in the upper left hand corner before redrawing in its correct location.

c) Its quite easy to get the bars to flash in an overlapped state before redrawing correctly. By this, I mean, if I drag the toolbars around, I can frequently see them painting on top of one another briefly before adjusting.

d) If I want to be anal about it, none of the themes really look very close to the real thing. Which is the whole point isn't it? Compare the Office 2003 style to the real Office 2003, the colors are way off.

2) In the BCGPMSOffice2007Demo (as of the one posted tonight):

a) Mouse over buttons so the tooltips appear. They often flash a black rectangle on the screen before repainting (easier to see on the expando buttons that have thumbnails)

b) Switching between active/inactive frame causes the frame buttons to jump around.

I could go on and on, but that was found in 5 minutes.

Sunday, November 11, 2007 3:46 AM by stevetei

# re: Quick Tour Of New MFC Functionality

To Carole and others that have asked why we didn't choose to build on top of the actual Office ribbon implementation: this is primarily a question of time-to-market and opportunity costs.  It would have taken us at least another 2 years to bring functionality such as this to market by building on top of Office ourselves and during that 2 years the team would not have been able to work on any other C/C+++ libraries features.  To be quite honest, we weren't willing to wait this long with the team unavailable for other libs projects in order to bring this functionality to customers.  We're really happy with what we found in BCGSoft, and the strategy we chose enables us get to market more quicky with a fantastic feature set with only some fine tuning integration, quality, performance, and security.

Thanks!

Steve Teixeira, Group Program Manager, VC++

Sunday, November 11, 2007 8:00 AM by Carole

# re: Quick Tour Of New MFC Functionality

Steve, thank you for your answer.

Honestly, I'm a big fan of VC++ and MFC. Then, I have another question about your decision of buying 3rd solution: Were there any technical or political reasons that prevent from using original Ribbon and UI source codes? I've expected those were written in native C/C++ code, so they can easily integrated into MFC library.

In my opinion, it would be much better if we would use *real* ribbon and other stuffs and not seeing source code, than using imitated gadgets and its open sources.

Sunday, November 11, 2007 9:13 AM by Chabster

# re: Quick Tour Of New MFC Functionality

http://www.bcgsoft.com/bcgcontrolbarpro-versions.htm Analyze the frequency of releases and number of defects resolved. With every version of this lib there are many bugfixes and new bugs injected by added features.

How Microsoft will guarantee the quality of BCG's code as a part of MFC?

Quality doesn't concern "flickering issues", i meant code quality. The library has been evolving for a long period of time and of course they were trying to make compatible versions with all those design and code quality problems.

Sunday, November 11, 2007 10:38 AM by stevetei

# re: Quick Tour Of New MFC Functionality

Carole: The notion of wrapping the Office version of the ribbon didn't present any political or legal issues to cause any concern.  There could, however, potentially be some techniccal issues, since it was written to meet the needs of MS Office and not necessarily optimized to provide for the best experience for developers that want to put a ribbon into any application.  In the end, we felt the path we chose gave us the best time to market as well as maximal utility and flexibility for developers incorporating ribbons into their applications.

Chabster: Perhaps we have different frames of reference here, but when I look at the page you reference I'm pretty impressed with the frequency of releases, the number of new features in these releases, and the modest number of bugs that need to be fixed.  At any rate, this code base went through several reviews, and we feel very good about its quality.  We're also doing even more work to improve quality and security as we integrate it into MFC proper.  As Ayman said, we will absolutely stand behind the quality of this library.

Sunday, November 11, 2007 12:26 PM by Sven

# re: Quick Tour Of New MFC Functionality

Steve, is Microsoft going to integrate these classes into mfc90.dll or is MFCnext an add-on to the core MFC? I would prefer the second.

Sunday, November 11, 2007 1:15 PM by Chabster

# re: Quick Tour Of New MFC Functionality

stevetei: Steve, will MS provide an MSDN like documentation for the whole library? BCG's is not pretty.

Sunday, November 11, 2007 1:28 PM by Jimmy

# re: Quick Tour Of New MFC Functionality

Chabster, thats so wrong, I don't even know where to begin. Flickering & drawing bugs doesn't matter to you as long as the code looks pretty underneath? Glad I didn't hire you to work on my GUI :).

Sunday, November 11, 2007 1:45 PM by Somebody

# re: Quick Tour Of New MFC Functionality

To the VC++ management who claim they don't see flickering and drawing issues in BCG:

Its not that hard to find them. Try download the demo off the BCG site and drag the toolbars around. They flash like crazy as they are being docked/undocked/redocked. I'm looking at it right now and the toolbars often repaint over one other and in completely the wrong locations and cause the bottom of the app window to flash like crazy as well.

Sunday, November 11, 2007 1:52 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Also...

1) None of the themes are very accurate to the original app. Ie. The Office 2003 theme generally looks like Office 2003, but the colors are pretty different. Same for the other themes.

2) Tooltips often flash black rectangles on the screen before repainting correctly (at least in the ribbon demo).

3) Ribbon frame buttons jump around between active & inactive states.

Yeah, most of these issues I've just mentioned are "minor", but having 1000's of "minor" issues isn't that good.

Sunday, November 11, 2007 2:02 PM by stevetei

# re: Quick Tour Of New MFC Functionality

Sven: The current plan is for all of the new functionality to be completely integrated into MFC (and, consequently, MFCxx.dll).

Chabster: Yes, we will have MSDN docs for everything we ship.

Somebody: It's great to see you're checking out BCGSoft's stuff, but please do keep in mind that there is more work we're doing here as a part of the MFC integration.  We we look forward to your feedback once we actually release a beta version of the software.  :)

Sunday, November 11, 2007 2:35 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Stevetei: Thanks for the response. I will definitely check out the beta. Still, I think the consensus that I've seen here and on other places discussing the new functionality is that regardless of the quality people would like to be able to "turn it off" much the way we don't need to ship ATL, STL, or even MFC if we don't want to. Would be nice if the BCG stuff was "integrated", but still modularized at the same time. Putting everything in the MFCxx.DLL will turn a thin 1.5MB DLL into a 20MB DLL.

Sunday, November 11, 2007 3:15 PM by Andre

# re: Quick Tour Of New MFC Functionality

"The current plan is for all of the new functionality to be completely integrated into MFC (and, consequently, MFCxx.dll)"

That sucks big time! Like me there are many others who don't want all that stuff and there is no justification why you bloat our apps.

I also don't understand why there is so much positive feedback (or is the negative just filtered?). Here is an analogy:

When a car maker releases a new model there will be all kind of aftermarket parts for it, from spoilers to seats. What Microsoft did is they took an aftermarket spoiler (the cheapest one they found), put it on the old MFC and try to sell it as a new version. So what's so cool about that? Just buy the spoiler (BCGControlBar) and put it on your old car (VS2005).

But maybe Microsoft follows a different strategy. With the integration of the BCGControlBar MFC apps will be bloated, sluggish and require a lot more memory than before, so nobody can say that for .NET apps in comparison any longer.

Sunday, November 11, 2007 4:03 PM by Sven

# re: Quick Tour Of New MFC Functionality

Somebody is right. The size of the BCG dll is round about 3.5 MiB, the Office 2007 images (blue, silver, black) need additional 5.0 MiB. I doesn't need this stuff, because I'm using Codejock's Xtreme Toolkit and I don't want to ship a 10 MiB MFCxx.dll instead of a 1.5 MiB dll.

Sunday, November 11, 2007 5:42 PM by phil

# re: Quick Tour Of New MFC Functionality

Can I use this lib in a plain win32 app?

Sunday, November 11, 2007 5:48 PM by Moritz

# Why not Codejock?

Hello! I work with the CodeJock Xtreme Toolkit Pro for a long time now. They implemented graphics and speed much better than BCG! Codejock matches MS graphics for 100 %. You should think once again about that!

Greetings, Moritz Leutenecker

Monday, November 12, 2007 12:26 AM by Joe

# re: Quick Tour Of New MFC Functionality

I third Somebody's request that this be put in it's own DLL.

(The SxS stuff totally and completely sucks as it is; adding this to the mix makes it even worse. After we shoot all the lawyers, I want to line up the idiots who came up with SxS.)

Monday, November 12, 2007 1:29 AM by Bruno

# re: Quick Tour Of New MFC Functionality

To those asking why the VC++ team didn't use Office's implementation of the Office 2k7 UI, I think Herb Sutter's blog tells it best:

http://herbsutter.spaces.live.com/Blog/cns!2D4327CC297151BB!343.entry

To summarize: Over the years, the Office team comes up with its own UI, then the Tools team and/or Windows team add it to the tools and/or OS.  The Tools and Window teams never use the Office team's implementation, because the Office team's implementation is for internal use by the Office team, and not meant or designed to be used as a library by 3rd parties.  The Office code isn't suitable for 3rd party use because it wasn't designed with that in mind.  This isn't the first time that the tools team has used 3rd party libs in its own offerings, and it makes sense because those 3rd party libs are built explicitly for 3rd party use (unlike the Office code).

Microsoft has been it this way for years.

But see Herb Sutter's blog, he says it better than I. :)

Monday, November 12, 2007 2:59 AM by Dariusz quatscht

# Neues von der MFC Front und TR1 Support

Auf der TechEd wurde die Katze aus dem Sack gelassen. Ale Contenti stellte die neuen Features der MFC

Monday, November 12, 2007 10:00 AM by Chris

# re: Quick Tour Of New MFC Functionality

Will the appropriate image files be made available for redistribution?  For that matter, has the image library been updated for VS2008?  The update for VS2005 was a huge step forward, but there seemed to be a large number missing (no I don't have a list) images, plus everything that is new for Vista.

Monday, November 12, 2007 10:15 AM by jschroedl

# re: Quick Tour Of New MFC Functionality

This is excellent news!  I for one am pleased to see MS' commitment to the C++ platform as we'll be using it for quite some time.  GUI additions like this are needed.  I can't wait to try them out!

Pat, can you tell us if we'll gain the ability to hide a window's menu bar and have it appear when the user presses Alt (ala IE and Media Center)?

Monday, November 12, 2007 10:23 AM by mschaef

# re: Quick Tour Of New MFC Functionality

What are the patent/licensing implications of using the new MFC Ribbon components in my software? My understanding is that Microsoft has imposed significant restrictions on that visual style:

http://www.microsoft.com/presspass/features/2006/nov06/11-21officeui.mspx

"The license [For the office-style UI] is available for applications on any platform, except for applications that compete directly with the five Office applications that currently have the new UI (Microsoft Word, Excel, PowerPoint, Outlook and Access"

If I build a commercial application using the Ribbon components of MFC, does it still need to be vetted out by the Office-UI licensing group?

Monday, November 12, 2007 11:15 AM by Ayman Shoukry

# re: Quick Tour Of New MFC Functionality

With regard to the licensing question, we are currently in process of finalizing such details. Most probably, the licesnse will adhere to the Office license you mentioned above.

"The license [For the office-style UI] is available for applications on any platform, except for applications that compete directly with the five Office applications that currently have the new UI (Microsoft Word, Excel, PowerPoint, Outlook and Access"

Thanks,

Ayman Shoukry

Lead Program Manager

Visual C++ Team

Monday, November 12, 2007 12:09 PM by Pat Brenner

# re: Quick Tour Of New MFC Functionality

Hi all! Whew! Thanks all for the feedback and questions.  I'll try to answer some of them here:

=========

Tony, re: "Are these examples in the SDK, or should I just figure them out all myself. Surely the application wizard doesn't just create me a VS look and feel app out of the box.?!"

Yes, these samples are all included in the MFC samples we are shipping with this feature pack.  And yes, the application can (but does not have to) create you a VS look and feel app right out of the box.

=========

Iain, re: "Is this the actual ribbon code from Office (MSO) refactored, or is it a separate ground-up implementation?  Will full source code be available for the new MFC, just as its has been for all prior releases of MFC?"

This is not the Office ribbon refactored, it is a separate implementation.  But it has been approved by the Office team with respect to their ribbon guidelines.  And full source code will be shipped as aw

=========

Pavel, re: "Is this MFC-Update only for VS2008? Are there any plans for VS2005 integration? What about PropertyGrid and ReportControl? Are they also a part of new MFC? What about deployment issue? Is it still one DLL (mfc90.dll)?

Yes, this update is only for VS2008.  There are no plans for VS2005 integration.  Property Grid is included.  And it is still one DLL.

=========

Somebody, re: "Putting everything in the MFCxx.DLL will turn a thin 1.5MB DLL into a 20MB DLL."

We have integrated everything into MFCxx.DLL, to simplify deployment.  But the DLL did not grow to 20MB. It grew from 1.2MB to 3.8MB.

=========

Chris, re: "Will the appropriate image files be made available for redistribution?"

There are load of image files included with the samples code.  All the screen shots in the original blog post are samples or app-wizard generate code, so you'll have access to all those images.

=========

JSchroedl, re: "can you tell us if we'll gain the ability to hide a window's menu bar and have it appear when the user presses Alt?"

I don't believe this will be supported in the feature pack, but it's an excellent suggestion for a future feature request.  Thanks!

Monday, November 12, 2007 12:32 PM by Andre

# re: Quick Tour Of New MFC Functionality

Thanks for filtering the negative comments!

But that doesn't make your decisions any better.

Monday, November 12, 2007 12:42 PM by Curt Nichols

# re: Quick Tour Of New MFC Functionality

> "But it has been approved by the Office team with respect to their ribbon guidelines."

Does this remove the need to license the 2007 Microsoft Office User Interface when using the MFC implementation?

(see http://blogs.msdn.com/jensenh/archive/2006/11/21/licensing-the-2007-microsoft-office-user-interface.aspx)

Monday, November 12, 2007 12:46 PM by Andre

# re: Quick Tour Of New MFC Functionality

"We have integrated everything into MFCxx.DLL, to simplify deployment.  But the DLL did not grow to 20MB. It grew from 1.2MB to 3.8MB."

I assume not including the visual styles?

Let me quote from this post made only a few days ago here on this blog (http://blogs.msdn.com/vcblog/archive/2007/10/28/more-on-the-korean-trip.aspx):

"Of course, we have received a number of excellent feature requests to be considered for our next versions of Visual C++: Componentized and light-weight MFC libraries"

So basically you're ignoring your customer requests and justify it by saying this simplifies deployment? That's absurd.

I and many others don't want this features and there is no justification why you increase the download size of our apps.

Monday, November 12, 2007 1:05 PM by Sven

# re: Quick Tour Of New MFC Functionality

@JSchroedl: Already implemented in MFC 9.0. Please check CFrameWnd::SetMenuBarVisibility()

Monday, November 12, 2007 1:43 PM by Ayman Shoukry

# re: Quick Tour Of New MFC Functionality

To clarify the office UI licensing questions, customer will still be required to click through the office agreement.

Thanks,

Ayman Shoukry

Visual C++ Team

Monday, November 12, 2007 1:57 PM by vcblog

# re: Quick Tour Of New MFC Functionality

Andre & somebody,

Thanks for the feedback!

With regard to the post regarding simplifying the deployment story, let me assure you that we are not igonring the customer feedback. We are currently considering how to ease the deployment of our libraries in general. Unfortunately, that won't be something in the VS2008 time frame since as you probably know, VS2008 will soon be out. We are looking into that for the next release.

Once more, we appreciate your feedback.

Thanks,

Ayman Shoukry

Visual C++ Team

Monday, November 12, 2007 2:04 PM by Ayman Shoukry

# re: Quick Tour Of New MFC Functionality

Andre, I checked the posts and spam filter and it looks like some of your posts were regarded as "possible spam"...don't know why though. I marked them as not spam and they should be visible now. Let me know if you can't see any of the posts you previously posted.

Thanks,

Ayman Shoukry

Visual C++ Team

Monday, November 12, 2007 2:05 PM by vcblog

# re: Quick Tour Of New MFC Functionality

To Andre & WhatDoesItMatter:

We aren't filtering any posts.  There were 3 posts caught by the blog software as "possible spam".  Once we checked for unposted comments this morning, we published them.

Bill

Visual C++ Development Team

Monday, November 12, 2007 3:21 PM by Markus

# re: Quick Tour Of New MFC Functionality

Huh? Why does the MFC need his own implementation of toolbars if Visual Studio already has one or better put: why doesn't VS use the one from MFC? "Doesn't eat Microsoft it's own dogfood?"

Monday, November 12, 2007 4:44 PM by Jimmy

# re: Quick Tour Of New MFC Functionality

I don't believe any major MS software uses MFC. Office uses its own private GUI library in native C++. Visual Studio uses something derived from that. Its not an MFC issue, its a Win32 issue. MFC is a thin wrapper (or at least it was) on the Win32 controls. Its the Win32 controls that dont provide a rich, modern UI. Blame the common control team for that :).

Monday, November 12, 2007 4:52 PM by Andre

# re: Quick Tour Of New MFC Functionality

@Bill & Ayman: Thanks for clearing that up. I know the comments were harsh but hopefully still respectful.

The reason why I absolutely dislike the integration of the BCGControlBar is because I've used the toolkit 2 years ago in my own app and I had to strip it out and replace it with Codejocks toolkit. The performance and quality went steep downhill. If you need to log and monitor engine parameters in realtime (where realtime means 100 samples per second) it's not affordable that the highlighting of some buttons takes up 100% cpu time. Also the look&feel (= user experience) was and is still not good. Just a few weeks ago I've removed the last #ifdef BCG.

And I really really doubt that this will change till the release of the new MFC. And even if you improve the toolkit, there is still no justification to switch back to BCGs implementation. What do your customers gain that they couldn't have before? You don't even have the controls ready for RTM.

I also prefer they current deployment model where the toolkit ships on top of the MFC. While I consider the MFC to be stable, updates are only required once a while when the Windows division shipped a new version, I want toolkit updates and bug fixes ASAP.

So there are many reasons why the BCGControlBar should not be integrated into the MFC:

a) You can ship MFC90.DLL with VS2008 RTM and can keep the version the same for the new controls

b) You can update the controls without the core MFC

c) Customer who do not wish to use the new controls don't need to deploy a MFC DLL triple the size as before

So please reconsider your decisions.

Monday, November 12, 2007 7:06 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Bill, Ayman, Andre: I totally agree with Andre on this. BCG performance and look & feel is bad (there is one toolkit out there that is even worse then BCG actually -- that one makes BCG look spectacular). I'm not trying to sell you on Codejock at all. If I was trying to sell you on a GUI lib, I'd sell you on mine :). Although at this point, my ribbon impl is not yet complete which is why I don't sell it.

All we are trying to say is that use whatever you want for "giving out for free purposes" because obviously we aren't going to convince you otherwise at this point in time (or probably ever). Although I think you'll find on here and on Usenet is the reaction to BCG in general is mostly negative. The point is at least make it modular to the point that we can drop in whatever library we want or none at all.

Think about it... say I want to give my boss (or client) a quick & dirty app to fix something or do something quick. The VS2005/2008 MFC is not yet common place, so we need to ship that. My boss and/or customer might be curious as to why I'm shipping a 4MB DLL all of a sudden.

For those that want to use the included BCG lib, fine for them. For those of us who want to use something more professional, fine for us :).

Monday, November 12, 2007 7:11 PM by Somebody

# re: Quick Tour Of New MFC Functionality

P.S. You already compile the debug version of MFC into multiple DLLs, so obviously this is a feasible request :).

Monday, November 12, 2007 7:24 PM by Norman Diamond

# re: Quick Tour Of New MFC Functionality

"We have integrated everything into MFCxx.DLL, to simplify deployment.  But the DLL did not grow to 20MB. It grew from 1.2MB to 3.8MB."

Does that growth include integrating ATLx.DLL and integrating MFC<humanlanguage>x.DLL into MFCxx.DLL, to simplify deployment?

If the answer is no then I second (or fifth or whatever) those who say the BCG library should be a separate DLL.

Monday, November 12, 2007 7:37 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Just do something like:

#define USE_BCGSOFT_LIB

or whatever in the StdAfx.h file. Then in the afx.h file, only include the BCG headers, libs and DLLs if that symbol is defined. Have the wizards put that define in automatically for new projects if they select the BCG mode from the wizard. If you want to get real fancy, give the option to "BCG-isize" projects during migration.

Simple as that. Everyone will be a happy camper. Those who want a free solution will be happy. Those who want a light weight plain MFC DLL will be happy, and those of us who want to use a different lib will be happy.

Tuesday, November 13, 2007 3:10 AM by Ben Anderson (MSFT)

# re: Quick Tour Of New MFC Functionality

Just a few comments:

Re: filtering - even my comments often get flagged as spam and don't show up for a day or two until one of the blog admins notice it.  Sorry about that, I'm not sure exactly what it is that triggers that - maybe if some word is close to a swear word or something?

JSchroedl, re: "can you tell us if we'll gain the ability to hide a window's menu bar and have it appear when the user presses Alt?"

Actually, this is one of the features that will be shipped in Orcas as part of the default/old school MFC menu bars and will be available at RTM without any updates necessary.  Not sure if it will work with the new stuff since it's designed to mimic Office and VS which don't do that as far as I'm aware.

Re: the merits of wrapping existing implementations vs coming up with new ones.  

The problem with trying to rip pieces out of Office or VS is that you want only to get the stuff you want and not any of the other stuff.  Any big app is it's own framework with its own legacy of crazy interdependencies.  Even if you did manage to pull out what you wanted, it's interface would probably need a lot of reworking to get it to work in a new framework or not to rely on assumptions about how Office or VS behaves.  Not that it's impossible, just that it's not always going to be the best decision.  Also, you don't necessarily want the overhead of VS to end up in your MFC app since the complexity of the VS GUI might be way more than you're interested in.  It's better in my opinion to provide a more customizable solution where you can turn features on or off and tweak them.  Providing an application framework and library is a slightly different problem that producing a one-off application.

To address concerns over file size:

I realize that some people don't like the additional size.  I think it's a small burden to bear myself in most situations (I'm sure there are some of you where this isn't the case).  Luckily, your situation will be somewhat mitigated since you can still deploy the Orcas RTM bits which won't include this update.  Once the update is out, the subsequent service releases will contain it, but I that growth is something whose benefits far outweigh the costs.  MFC could turn into a perpetual maintenance-mode library, but personally that wouldn't make me any happier.  If that happened (and let's be honest - to a large extent that's what happened the last couple years on the visuals front), you would see a continuously dwindling investment and a higher and higher bar to fix bugs.  Instead what this does is really revitalize MFC as a platform, contributes to making it an interesting product to work on and makes it a viable platform for continued development.

Anyway, I can say that personally I'm excited about the enhancements coming down the pipe.  It's great to finally see a wizard generated MFC App that doesn't look like a time capsule from 1998.  I think it's great that we're able to drop this so soon after VS2008 and am even more excited about the possibilities this opens up for the next version of VS.

Thanks!

Ben Anderson

Visual C++ Libraries Team

Tuesday, November 13, 2007 3:45 AM by Nima

# re: Quick Tour Of New MFC Functionality

Can we use these features for Native programs are written in Win32 APIs ?

or it is just for MFC ?

Tuesday, November 13, 2007 3:56 AM by Marcus

# re: Quick Tour Of New MFC Functionality

@Nima: It's obviously just for MFC Apps.

@MSFT: You should really make sure to purchase the best-quality GUI lib available for yourself and your customers. It's a major decision. Once you've shipped it, you will have to fix and tweak it for decades. Just getting it cheap and quickly is a bit shortsighted.

Tuesday, November 13, 2007 6:09 AM by Athan

# re: Quick Tour Of New MFC Functionality

Thanks God, I still code using Win32 APIs alone!

@MSFT: Pushing new design concepts using a cheap immitation like BCG, is a bad desision, very bad...

Tuesday, November 13, 2007 6:42 AM by Andre

# re: Quick Tour Of New MFC Functionality

"Luckily, your situation will be somewhat mitigated since you can still deploy the Orcas RTM bits which won't include this update."

I don't consider "RTM bits" for production use. You've lost your last creditability with VS2005.

I would like to raise my concers with this again:

a) Performance and quality. Both are abysmal and you know it.

b) File size. Don't want to repeat myself, there is no technical reason that justifies the bundling but many not to do it.

c) Compile time. Including the BCGControlBar in the precompiled header increases the compile time by about 50%.

d) Legal issues. Bundling the BCGControlBar with the MFC is anticompetitive. It's the same as the Media Player and Windows. Therefore I'm going to report this to the European Commissioner for Competition (http://ec.europa.eu/commission_barroso/kroes/index_en.html), and hopefully they will act. Maybe a petition would be helpful. I'm looking forward to the N SKU of Visual Studio.

Visual C++ lacks so many features, refactoring, code metrics (!), C99, etc. It has become a absolutely pathetic product.

Tuesday, November 13, 2007 10:58 AM by Somebody

# re: Quick Tour Of New MFC Functionality

Nice to know our comments and feedback (people who actually USE MFC -- think about MSFT, you DON'T use it) have been *useless* and a *waste of time*. The general attitude from MSFT on this topic has been:

Us: "BCG is poor quality"

Msft: "We disagree"

Us: "Heres a list of problems..."

Msft: "We still disagree"

Us: "We are concerned about file size and code quality"

Msft: "We aren't, we got this code on the cheap. You'll have to live with it"

Us: "We are concerned about turn around with the bug fixes"

Msft: "Come on, you can't wait 2 to 3 years for the next release?? We haven't released timely fixes since Visual Studio Studio 4.x"

Us: "Fine, how about at least putting it in a seperate DLL so we can turn it off if we want?"

Msft: "No"

Tuesday, November 13, 2007 12:05 PM by Somebody

# re: Quick Tour Of New MFC Functionality

I suggest everyone send Mr Kroes a polite "me too" email about this issue (as I have done) whether you are in Europe or not. The only customer feedback MSFT seems to listen to is "anti-trust" and "class action lawsuit".

Tuesday, November 13, 2007 12:25 PM by Tomas

# re: Quick Tour Of New MFC Functionality

Us: "BCG is poor quality"

Obviously, there was no choice. In any case Microsoft had to take either BCG, or CodeJock. Unfortunately, CodeJock is not any better: non MFC-native design, product stability, high maintenance cost (a lot of +5, -7 in the code makes it slightly faster - but it's a pain to maintain)/overall code quality, lack of certain features - all of that puts it aside.

"We aren't, we got this code on the cheap. You'll have to live with it"

You certainly can't know the price, unless you work for MSFT or for BCGSoft. Yes, BCGSoft's code is easier to maintain, from this point of view it's cheap.

"We are concerned about file size and code quality"

Yes, some ifdefs would help. Regarding the code quality I said above.

"We are concerned about turn around with the bug fixes"

So again, taking the CJ's code quality into account it wouldn't be better.

Tuesday, November 13, 2007 1:04 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Well, it seems the MFC community in general thinks CJ is a better library. I have not used either library in my applications (and have no intention to), but I have *closely* examined demos from BCGSoft, Codejock and a few others. If I had to pick one of the libs based off of demos alone, I'd take a few + 5 and - 7's over insane flicker and painting bugs any day of the week. In fact, I'll even tell you that my GUI library has a lot of performance tweaks like that (as I'm sure Windows itself does) as well and I maintain it just fine. Its an MFC native design and reuses Win32 controls wherever possible (including the real win32 menus). So I add + 5 or subtract - 7 in a few places or assume a radio buttons size. I don't assume things that will "commonly" change like fonts or string lengths, etc. Unlike BCG, I'd challenge you to find an iota of flicker in my GUI lib or performance issues. And *that* is my goal.

Tuesday, November 13, 2007 1:10 PM by Somebody

# re: Quick Tour Of New MFC Functionality

P.S. I don't mean to imply that my lib is only hardcoded for specific setups. It works just fine on NT4, NT5, XP, 2003 and Vista. It also works just fine with all themes, classic mode and high contrast mode and can change on the fly at runtime (something which was clearly not tested in VS or BCG). I also provide speedy fallback functions for earlier OSes (ie. 32bit alpha BMP support on NT4 and NT5). My point is, you can have performance optimizations and still work fine across the board and be maintainable.

Tuesday, November 13, 2007 1:20 PM by Tomas

# re: Quick Tour Of New MFC Functionality

So would you buy a tweaked sport car to take your children to school? :)

Tuesday, November 13, 2007 1:29 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Not if its lights flickered.

Tuesday, November 13, 2007 2:47 PM by Tomas

# re: Quick Tour Of New MFC Functionality

a) Performance and quality. Both are abysmal and you know it

Sorry, but it's just your humble opinion. Many others think differently. You can find the proof in many famous products incorporating BCG's stuff, and you can read MHO about CJ's code above. So, who's right?

b) File size. Don't want to repeat myself, there is no technical reason that justifies the bundling but many not to do it.

So, if XT was included, what would be the difference?

c) Compile time. Including the BCGControlBar in the precompiled header increases the compile time by about 50%.

Just buy a faster computer. Haven't you bought one for the Vista yet?

d) Legal issues.

So just assume MS has developed its own technology for the ribbons and other stuff. Does it make the competiotr's life easier? Would you spam Mr Kroes in that case?

Tuesday, November 13, 2007 3:17 PM by Vlasta

# re: Quick Tour Of New MFC Functionality

I was hoping for something more than integration of an already available library when reading about VS2008 support for the ribbon control. Something lightweight and to the point, not a bloated library that is only usable with MFC. I have switched to WTL a loooong time ago and it is superior to MFC in almost every aspect. Oh, well...no good news for me then.

A little rant: Why does Microsoft invest in such monsters as MFC and .net framework? If it were not Microsoft pushing these technologies, nobody will be using them.

Tuesday, November 13, 2007 6:57 PM by Somebody

# re: Quick Tour Of New MFC Functionality

Tomas,

You should try read the responses on here, newsgroups, etc. Its not mine or Andres opinion. Its that of most people. Yeah, so Nero uses it. Big whoop. Nero doesn't exactly have the best UI.

Buy a faster computer? Uh, you want to pay for it?

While I think CJ is the better product when compared to BCG, I wouldn't want CJ integrated either.

I clearly stated that while its good for some people to have the free library (of any kind or quality), it should not be forced on us because of whatever reason MS chose.

We simply stated we wanted it in a different DLL so we could turn it off.

Doesn't BCG require me to now ship GDI+ too? I recall reading they have an #ifdef to turn that off, but how is that going to work if its all integrated into MFC?

I have less use for the bloated GDI+ then I do for BCG.

Tuesday, November 13, 2007 9:05 PM by Tomas

# re: Quick Tour Of New MFC Functionality

"You should try read the responses on here, newsgroups, etc. Its not mine or Andres opinion. Its that of most people."

ACD Systems, Altova - "big whoop" too? The list of BCG's customers is big enough...

In addition, I won't be surprised if this "most of people" is just a few guys spaming across news groups and blogs under different names.

"We simply stated we wanted it in a different DLL so we could turn it off."

This simple statement is accompanied by words like "horrible" and so on. Do you think it's fair? You have to prove that first. Otherwise everything you say is senseless.

Tuesday, November 13, 2007 9:24 PM by Tomas

# re: Quick Tour Of New MFC Functionality

Oh, I did exactly as you recommended, Somebody, and found Andre's opiniton here (pretty sure it's him):

http://www.bcgsoft.com/cgi-bin/forum/topic.asp?TOPIC_ID=3704

I'm just wondering what made this guy so angry at BC