CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

jobs.internet.com

internet.commerce
Partners & Affiliates
Laptops
Condos For Sale
Televisions
Online Shopping
Disney World Tickets
Promotional Gifts
Baby Photo Contest
KVM Switch over IP
Phone Cards
Laptop Batteries
Promos and Premiums
Memory
Calling Cards
Online Education


RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

Home >> Columns >> Using VC++ .NET


MFC Controls for Vista
Rating: none

Nick Wienholt (view profile)
September 4, 2007

Go to page: 1  2  Next

Since the introduction of the .NET Framework in 2002, MFC has not been an area that has seen many new features added or a lot of focus from Microsoft. Much of the slow-down in MFC can be attributed to the lack of a major new release of the Windows operating system during this period, but there was also an undercurrent that native development was dead, and this made any MFC improvements redundant. With the release of Visual Studio 2008 and the thousands of new native APIs in Windows Vista, native development is alive and well, and thankfully MFC has benefited from this native renaissance with a range of new controls and improvements to existing controls that support the new look-and-feel of Vista.


(continued)



Web Devs:
Moonlight as a Game Developer and Win Cool Prizes by Accepting the RIA Run Challenge

Now, your mission--should you choose to accept: Take your shot at gaming stardom if you think you might have what it takes to build a cool RIA game and you could win an Xbox 360 or other fabulous prizes. Hurry! You only have until May 15, 2008 to enter. »

 
Article:
Leveraging Your Flash Development with Silverlight

You're not giving up Flash any time soon (and we don't blame you.) But if you could get your Flash application working in Silverlight, why wouldn't you? We show you the tools and techniques required to have your rockin' Flash application rolled for Silverlight. Learn more here. »

 
Article:
What Does it Take to Build the Best RIA?

With the proliferation of Rich Interactive Application (RIA) platform choices out there, you no longer have to take a one-size-fits-all approach to developing your next RIA application. Knowing the strengths (and weaknesses) of each platform can help you to decide the best RIA for your next application. »

 

For new MFC applications created with Visual C++ 2008, all MFC controls that are added to a dialog will automatically take advantage of the new Vista controls when the MFC application is executed on Vista or above. In much the same way, taking an application that was developed with an earlier version of Visual C++ and recompiling it with Visual C++ 2008 will result in an executable that will take advantage of Vista common controls when run on Vista. When executed on Windows Server 2003 or earlier, MFC-based applications will gracefully downgrade to the older common controls. The File Save dialog that is produced by taking the Scribble sample application that shipped with Visual C++ 6, re-compiling it with Visual C++ 2008, and running the application on Windows Vista is shown in Figure 1.


(
Full Size Image)

Figure 1: Scribble Compiled with Visual C++ 2008 running on Vista

The same executable will look like Figure 2 when executed on Windows Server 2003.


(Full Size Image)

Figure 2: Scribble Compiled with Visual C++ 2008 running on Windows Server 2003

For the sake of completeness, Figure 3 shows the same Scribble application compiled using Visual C++ 2005 running on Windows Vista.


(Full Size Image)

Figure 3: Scribble Compiled with Visual C++ 2005 running on Vista

In the case of the Scribble application, the MFC document-view architecture is automatically handling the display of the file dialogs, but if a CFileDialog-derived dialog is being created explicitly in code, a new optional parameter has been added to the constructor to specify whether Vista-style dialog boxes should be used, as shown in Figure 4.


(Full Size Image)

Figure 4: CFileDialog constructor parameter list

Simply re-compiling a code base using Visual C++ 2008 will go some way to giving the application a Vista look-and-feel, but it will still be necessary to manually change a number of settings to fully take advantage of Vista. One of the first manual checks is to make sure the fonts in the various UI controls have a font setting that will display well on Vista. The font setting for the Pen Width dialog in Scribble is MS San Serif, which is a bitmap font that can't be anti-aliased using Vista's ClearType technology. The use of a non-ClearType font looks slightly out of place when executed on Vista, as shown in Figure 5.

Figure 5: Scribble Pen Width Dialog with MS San Serif font

By using the Properties Window of the Pen Width Dialog, the Use System Font property can be set to true. This setting means that the dialog will use the pseudo-font MS Shell Dlg. When this pseudo-font is used, a Registry key located at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\FontSubstitutes is used to translate this to a real font, which in the case of a Vista installation that uses English will be Microsoft Sans Serif. In contrast to the similarly named MS San Serif, Microsoft Sans Serif is an OpenType font format, and OpenType fonts can be anti-aliased with ClearType technology. Although the difference is subtle, as shown in Figure 6, the difference is apparent on Vista where ClearType display is the norm.

Figure 6: Scribble Pen Width Dialog on Vista with System Font set to True

Go to page: 1  2  Next

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Five Trends for Application Development & Program Management. Download Complimentary Report Now.
Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Whitepaper: Embeddable Content Platform for OEM's


RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
No Comments Posted.
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES