YOU CAN CODE!

 

With The Case Of UCanCode.net  Release The Power OF  Visual C++ !   HomeProducts | PurchaseSupport | Downloads  
View in English
View in Japanese
View in
참고
View in Français
View in Italiano
View in 中文(繁體)
Download Evaluation
Pricing & Purchase?
E-XD++Visual C++/ MFC Products
Overview
Features Tour 
Electronic Form Solution
Visualization & HMI Solution
Power system HMI Solution
CAD Drawing and Printing Solution

Bar code labeling Solution
Workflow Solution

Coal industry HMI Solution
Instrumentation Gauge Solution

Report Printing Solution
Graphical modeling Solution
GIS mapping solution

Visio graphics solution
Industrial control SCADA &HMI Solution
BPM business process Solution

Industrial monitoring Solution
Flowchart and diagramming Solution
Organization Diagram Solution

Graphic editor Source Code
UML drawing editor Source Code
Map Diagramming Solution

Architectural Graphic Drawing Solution
Request Evaluation
Purchase
ActiveX COM Products
Overview
Download
Purchase
Technical Support
  General Q & A
Discussion Board
Contact Us

Links

Get Ready to Unleash the Power of UCanCode .NET


UCanCode Software focuses on general application software development. We provide complete solution for developers. No matter you want to develop a simple database workflow application, or an large flow/diagram based system, our product will provide a complete solution for you. Our product had been used by hundreds of top companies around the world!

"100% source code provided! Free you from not daring to use components because of unable to master the key technology of components!"


Visual C++ 2008 Feature Pack: MFC Visual Studio Office 2007 Style Enhancements

 
 
As Microsoft promised last year, the focus for Visual C++ 2008 features going forward is development in native code and code that spans the gap between the native and managed worlds. Keeping full-feature parity with managed-only languages like C# and Visual Basic.NET does not make a lot of sense for Visual C++ 2008 as a product, because focusing on managed-feature parity distracts from the areas where Visual C++ stands alone as a product: native and interoperability coding. Visual C++ 2008 provides strong proof for Microsoft's renewed commitment to native code, with significant MFC updates providing full support with the Windows common control library for the first time in a decade. Not content with merely covering Windows, the Visual C++ team has released the Visual C++ 2008 Feature pack ( available for download here) that provides built-in support for developing applications that have Visual Studio- and Microsoft Office-like user interfaces. As this article on the MSDN web site explains, the MFC update has been completed with an external company (BCGSoft) partnering with Microsoft's Visual C++ team.

Installing the Beta of the Visual C++ 2008 Feature Pack can be a little tricky; the installer has a bug that terminates the installation if a full installation of Visual Studio 2008 is not present OR the original media from where Visual C++/ Visual Studio has been installed is not available. The simplest workaround is simply to put the Visual Studio 2008 DVD in the disc drive or ensure that network access to the original Visual Studio installation location is available. In addition, the 303MB download of the Feature Pack does not include any documentation, and a separate 3MB download is required from MSDN to gain access to the two CHM files that describe the new features.

The Feature Pack is divided into two distinct areas of functionality: MFC updates and TR1 functionality. TR1 is a set of additions to the C++ language that are an interim step towards the new features set to be formally adopted as part of C++ in the C++0x release (0x designating that the new standard is expected to be adopted this decade). TR1 is more fully described in this MSDN blog post, and will be covered in depth in an upcoming article.

MFC Updates

Since Visual C++ 6 was released in 1998, MFC went into a gradual decline, where the features of controls released as part of the Windows operating system where not included in subsequent MFC releases as they had been in the days before .NET. With Visual C++ 2008, MFC received a major update, as covered previously. With the Feature Pack, the update of MFC continues, and the development of an application that looks good running on the Vista operating system and next to applications such as Internet Explorer 7 and Office 2007 is easy. To gain a quick appreciation of what an MFC application built using the Feature Pack looks like, running the samples gives a strong indication that this isn't your grandfather's MFC.

Figure 1 shows the MSOffice2007Demo sample application that ships with the Feature Pack. At a casual glance, the application would easily pass as part of Office 2007, and the fact that this is a MFC application without any third-party controls and without hundreds of lines of owner-drawn GUI hacks is stunning considering how dated MFC used to look compared to its Windows Forms and WPF cousins.

Figure 1: MSOffice2007Demo sample application.

Even though there a number of new UI elements shown in Figure 1, the Ribbon control is the most obvious update that instantly delivers the wow-factor to the application. A ribbon control offers a huge range of functionality to a user, and trying to implement a ribbon control from scratch is a massive undertaking. To gain some sense of the complexity involved in the MFC ribbon implementation, there are 25 separate CPP files that make up the ribbon control implementation, and they weigh in at a massive half a megabyte of source code.

Upgrading an existing application to move from a standard menu and toolbar UI to a ribbon-based UI is not an overly difficult undertaking. The main tucancode.net is adding CMFCRibbonBar and CMFCRibbonApplicationButton member variables to the applications CMainFrame class, and then adding a CMFCToolBarImages member variable to hold the various images that will be shown on the ribbon. Each tab on a ribbon (like the Home, Insert, and Page Layout tabs in Microsoft Word 20007) are referred to as a category, and new categories are added to a ribbon by calling the CMFCRibbonBar::AddCategory method, which takes a large and small icon strip.

In addition to the new member variables needed in the CMainFrame class, most of the base classes in the MFC-generated code need to be modified to use the new style Ex clases; CWinAppEx, CMDIFrameWndEx, CMDIChildWndEx, and CSplitterWndEx all need to be substituted for their non-Ex versions. Because the new Ex classes are all derived from the non-Ex versions, the impact on an application is fairly minimal.

Thankfully, the MFC application wizard also isupdated by the installation of the Visual C++ 2008 Feature Pack, and it is possible to generate an Office-2007–like application with full ribbon support directly from the application wizard. Within the MFC app wizard, the Application Type step has been updated with the inclusion of a number of new Visual Style and Colors, as shown in Figure 2.

Figure 2: Visual Styles for a new MFC Application

For applications generated with one of the Office 2007 visual styles, the application will contain a drop-down menu on the top of the ribbon control to change among the various Office 2007 color schemes, as shown in Figure 3

Figure 3: Changing the color for a Office 2007-styled application

Using a ribbon rather than a standard menu is accomplished with the app wizard setting shown in Figure 4. Even if an existing application is being upgraded to support a ribbon-based UI, it is worth generating a new skeleton application just to get a template for the menu bitmaps required to support the ribbon; these are quite detailed. The ribbon control generated by the application wizard can be seen in Figure 3

Figure 4: Using a Ribbon Bar in a New MFC Application

In addition to the ribbon control, the MFC Feature Pack supports docking of windows in the same style as Visual Studio. Setting up the docking is relatively easy—to support smart docking, a call to the docking manager is all that is required:

CDockingManager::SetDockingMode(DT_SMART);

With smart docking applied, windows being dragged around the screen will have the same visual clues as to their destination that Visual Studio shows, as shown in Figure 5.

Figure 5: Smart Docking in Action

The Visual C++ 2008 Feature Pack updates MFC to a level that it has never previously attained, making it possible to quickly and simply develop an application that is visually similar to the lastest version of Microsoft Office. For developers who have struggled for years with owner-drawn controls and poorly-supported third-party toolkits, having such powerful UI functionality being co-developed and supported by the Visual C++ team is great news, and, as evidence of the continuing renaissance of native development in Visual C++, the Feature Pack is a wonderful piece of software

 

 

 

Copyright ?1998-2022 UCanCode.Net Software , all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.net