What’s New in Visual C++ 2010

What’s New in Visual C++ 2010
This topic introduces new and enhanced Visual C++ features in Visual Studio 2010.
Amazon: Bestsellers Electronics and Photo

Visual C++ Projects and the Build System
MSBuild
Visual C++ solutions and projects are now built by using MSBuild, which replaces VCBUILD.exe. MSBuild is the same flexible, extensible, XML-based build tool that is used by the other Visual Studio languages and project types. Consequently, Visual C++ project files now use an XML file format, and have the .vcxproj file name extension. Visual C++ project files from earlier versions of Visual Studio are automatically converted to the new file format. For more information, see MSBuild (Visual C++).

VC++ Directories
The VC++ Directories setting now resides in two places. Use project property pages to set per-project values for VC++ directories. Use the Property Manager and a property sheet to set global, per-configuration values for VC++ directories.

Amazon: Bestsellers Electronics and Photo

Project-to-Project Dependencies
In earlier releases, you could define dependencies between projects that were stored in the solution file. When these solutions are converted to the new project file format, dependencies are converted to project-to-project references. This change can affect applications since the concepts of solution dependencies and project-to-project references are different.

Macros and Environment Variables
The new _ITERATOR_DEBUG_LEVEL macro invokes debugging support for iterators. Use this macro instead of the older _SECURE_SCL and _HAS_ITERATOR_DEBUGGING macros.

Amazon: Bestsellers Electronics and Photo

Visual C++ Libraries
/analyze Warnings
Most /analyze (Enterprise Code Analysis) warnings have been removed from the CRT, MFC, and ATL libraries.

Restart Manager
The restart manager automatically saves documents and restarts your application if it unexpectedly closes or restarts. For example, you can use the restart manager to start your application after it is closed by an automatic update. For more information about how to configure your application to use the restart manager, see How to: Add Restart Manager Support.

Amazon: Bestsellers Electronics and Photo

MFC Library
The CTaskDialog class can be used instead of the standard AfxMessageBox message box. The CTaskDialog class displays and gathers more information than the standard message box does.

New ATL macros
New macros were added to ATL to expand the functionality of PROP_ENTRY_TYPE and PROP_ENTRY_TYPE_EX. PROP_ENTRY_INTERFACE and PROP_ENTRY_INTERFACE_EX enable you to add a list of valid CLSID’s. PROP_ENTRY_INTERFACE_CALLBACK and PROP_ENTRY_INTERFACE_CALLBACK_EX enable you to specify a callback function to determine if a CLSID is valid.

New Libraries
The SafeInt Library performs safe arithmetic operations that account for integer overflow. This library also compares different kinds of integers.

IDE
Improved IntelliSense Errors
In Visual Studio 2010, the integrated development environment (IDE) better detects errors that could cause a loss of IntelliSense and displays red wavy underlines under them. In addition, the IDE reports IntelliSense errors to the Error List Window. To display the code that is causing the problem, double-click the error in the Error List Window.

#include Auto-Complete Feature
The IDE supports auto-completion for the #include keyword. When you type #include, the IDE creates a pull-down list of valid header files. If you continue by typing a file name, the IDE filters the list based on your entry. At any point, you can select on the list the file you want to include. This lets you quickly include files without knowing the exact file name.

Amazon: Bestsellers Electronics and Photo

Visual C++ Compiler and Linker
auto Keyword
The auto keyword has a new purpose. Use the default meaning of the auto keyword to declare a variable whose type is deduced from the initialization expression in the declaration of the variable. The /Zc:auto compiler option invokes either the new or the previous meaning of the auto keyword.

decltype Operator
The decltype operator returns the type of a specified expression. Use the decltype operator in combination with the auto keyword to declare a type that is either complex or known only to the compiler. For example, use the combination to declare a template function whose return type depends on the types of its template arguments. Or, declare a template function that calls another function, and then returns the return type of the called function.

Lambda Expressions
Lambda functions have a function body but no name. Lambda functions combine the best characteristics of function pointers and function objects.

Use a lambda function by itself, as a template function parameter instead of a function object, or together with the auto keyword to declare a variable whose type is a lambda.

Rvalue Reference
The rvalue reference declarator (&&) declares a reference to an rvalue. An rvalue reference lets you use move semantics and perfect forwarding to write more efficient constructors, functions, and templates.

Amazon: Bestsellers Electronics and Photo

static_assert Declaration
A static_assert declaration tests a software assertion at compile time, unlike other assertion mechanisms that test at run time. If the assertion fails, the compilation fails and a specified error message is issued.

nullptr and __nullptr Keywords
The Visual C++ compiler lets you use the nullptr keyword with native code or with managed code. The nullptr keyword indicates that an object handle, interior pointer, or native pointer type does not point to an object. The compiler interprets nullptr to be managed code when you use the /clr compiler option, and native code when you do not use the /clr option.

The Microsoft-specific __nullptr keyword has the same meaning as nullptr, but it applies to native code only. If you compile native C/C++ code by using the /clr compiler option, the compiler cannot determine whether the nullptr keyword is a native or a managed term. To make your intention clear to the compiler, use the nullptr keyword to specify the managed term, and __nullptr to specify the native term.

/Zc:trigraphs Compiler Option
By default, support for trigraphs is disabled. Use the /Zc:trigraphs compiler option to enable trigraphs support.

A trigraph consists of two consecutive question marks (??) followed by a unique third character. The compiler replaces a trigraph with the corresponding punctuation character. For example, the compiler replaces the ??= trigraph with the # (number sign) character. Use trigraphs in C source files that use a character set that does not contain certain punctuation characters.

Amazon: Bestsellers Electronics and Photo

New Profile-Guided Optimization Option
PogoSafeMode is a new profile-guided optimization option that lets you specify whether to use safe mode or fast mode when you optimize your application. Safe mode is thread-safe, but it is slower than fast mode. Fast mode is the default behavior.

New Common Language Runtime (CLR) Option /clr:nostdlib
A new option is added for /clr (Common Language Runtime Compilation). If different versions of the same libraries are included, a compile error is issued. The new option lets you exclude the default CLR libraries so that your program can use a specified version.

New pragma directive detect_mistmatch
The pragma directive detect_mismatch enables you to place a tag in your files that is compared to other tags with the same name. If there are multiple values for the same name, the linker issues an error.

Tools
ATL Control Wizard
The ATL Control Wizard no longer automatically populates the ProgID field. If an ATL control does not have a ProgID, other tools may not work with it. One example of a tool that requires controls to have a ProgID is the Insert Active Control dialog box. For more information about the dialog box, see Insert ActiveX Control Dialog Box.

MFC Class Wizard
Visual Studio 2010 reintroduces the MFC Class Wizard. You can invoke the class wizard from anywhere in your solution. The wizard lets you add classes, messages, and variables without manually modifying the individual code files.

Microsoft Macro Assembler Reference
The addition of the YMMWORD data type supports the 256-bit multimedia operands that are included in the Intel Advanced Vector Extensions (AVX) instructions.

Amazon: Bestsellers Electronics and Photo


© Copyright 2010 Sorin Mustaca, All rights Reserved. Written For: Sorin Mustaca on Cybersecurity

Check www.mustaca.com for the IT Consulting services I offer.
Visit www.itsecuritynews.info for latest security news in English
Besuchen Sie http://de.itsecuritynews.info für IT Sicherheits News auf Deutsch

About the Author

Sorin Mustaca

Sorin Mustaca, (ISC)2 CSSLP, CompTIA Security+ and Project+, is working since year 2000 in the IT Security industry and worked between 2003-2014 for Avira as Product Manager for the known products used by over 100 million users world-wide. Today he is an independent IT Security Consultant focusing on Cybersecurity, secure software development and security for IoT and Automotive. He is also running his personal blog Sorin Mustaca on Cybersecurity and is the author of the free eBook Improve your security .

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close