260 likes | 462 Views
Visual C++ 2008 Overview & New Features. Boris Jabes Program Manager Visual C++ Microsoft Corporation. The themes of Visual C++ 2008. Vista Development Productivity Interoperability. Vista Development. So, what's new (for you) in Vista?. Aero Aesthetics Common Controls Task Dialogs
E N D
Visual C++ 2008Overview & New Features Boris Jabes Program Manager Visual C++ Microsoft Corporation
The themes of Visual C++ 2008 • Vista Development • Productivity • Interoperability
So, what's new (for you) in Vista? • Aero Aesthetics • Common Controls • Task Dialogs • Search • Wizards • Common Dialogs • Control Panels • Icons • System Font (Segoe UI) • User Account Control • Notifications • Text and Tone • Restart Manager • Function Discovery • Cancellable I/O • Error Reporting API • RSS Feeds • Network Awareness • Low-Rights IE • ASLR
Updates to MFC • Hide/Unhide the Menu Bar • New File Dialogs • Support for the new Common Controls
Toggling the Menu Bar • New methods in CFrameWnd class to hide or show menu in an MFC Application • Methods to dynamically toggle menu to become hidden or visible • Event handlers for custom actions when menu is about to be hidden or visible. • No support to toggle the menu bar in MDI and dialog-based applications virtual void CFrameWnd::SetMenuBarVisibility(DWORD nStyle); virtual DWORD CFrameWnd::GetMenuBarVisibility();
MFC Common File Dialogs • By default, MFC applications compiled under VC2008 will utilize Vista-style dialogs on Vista • New Methods Called • The new MFC Common File Dialog uses IFileDialogEvents instead of OnNotify • If the user runs the program in a pre-Vista OS, then the dialogs default to the old-style dialogs
MFC Controls • Fell behind since Win9x. Now up-to-date • New Control Messages • New WM Messages • New Controls like Pager Control • Includes new Vista controls
User Account Control • Available out of the box • Linker Switch • /MANIFESTUAC • Project Setting > Linker > Manifest File • Project Upgrade • UAC is turned on, level is set to “asInvoker”
Developer != Admin • Register COM components as normal user • Put them into HKCU when developing • Maintain existing deployment • Support for debugging IE7 Protected Mode • Debugger to Launch > Web Browser Debugger
Security Bulletin • Let’s review • /GS • /SafeSEH • DEP • New in Vista: ASLR • Linker switch (/DYNAMICBASE) to opt in to support ASLR • http://msdn2.microsoft.com/en-us/library/bb430720.aspx
IDE Support for Icons • Support for viewing PNG and Vista compressed icons • Icon Editor Preview Area 256 px
Build in Parallel • In 2005 • Build Multiple Project in Parallel • Tools > Options > Project and Solutions > Build and Run > Parallel Project Builds • In 2008 • Build Multiple Translation Units in Parallel • /MP or /MPn (where n is no. of CPUs) • Project Properties > C/C++ > Command Line > Additional Options
Managed Incremental Build A.dll A.Dll … ClassB b; b.f() … B.meta B.dll B.meta(*) B.Dll public ref class ClassB { public String f() { //important string here return “Important String”; } } Skip projects with no “significant” changes since last build
Marshaling • New library to simplify passing data between native and managed code • Template-based pattern that applies to any kind of data • Support lots of types out-of-the-box
Stateless Transition • I want to marshal between managed and native data types for conversions that do not require any lifetime management or complex resource allocation #include <msclr/marshal.h> using namespace msclr::interop; … { … const char* sourcestring1 = “teststring” System::String^ deststring1; // Convert const char* to System::String^ using // TO to = marshal_as <TO> (from) deststring1 = marshal_as<System::String^>(sourcestring1); … }
Stateful Transition • I want to marshal between managed and native data types for conversions that require some kind of lifetime (memory, resource, etc…) #include <msclr/marshal.h> using namespace msclr::interop; … { … System::String^ sourcestring1 = “teststring” const char* deststring1; //Convert System::String^ to const char* using //TO to = context.marshal_as<TO>(from) marshal_contextctx; deststring1 = ctx.marshal_as<const char*>(sourcestring1); … }
STL/CLR • Leverage STL skills in applications that use .NET Framework • Ease data exchange between STL and .NET Collections • The power of templates and generics together • Designed to achieve optimal performance and cross-language compatibility • STL in any part of managed code (but only C++)
Class Designer • Only does visualization of code
Q & A • Me – http://blogs.msdn.com/borisj • VC++ - http://blogs.msdn.com/vcblog