Tag Archive for Visual C++ 2010

Belgian C++ User Group Dinner (Monday 13th of February at 19:00)

The Belgian C++ User Group is organizing a dinner on Monday 13th of February at 19:00, somewhere in the Brussels area, but the place depends on the number of people coming.

Already joining us:

  • Tarek Madkour from Microsoft, Principal Program Manager Lead in the Visual C++ team
  • Jim Hogg from Microsoft, his main focus is C++ compiler optimizations

If you ever wanted to speak directly with the Microsoft Visual C++ development team, now is your chance.
If you know any C++ people that would be interested in this, please tell them about it.

Since I need to make reservations somewhere, please let me know (marc.gregoire@nuonsoft.com) before 31st of January if you are joining us for dinner.

If you have any questions, don’t hesitate to ask me.

PS: this is not a sponsored dinner, so everyone should pay for themselves, but that shouldn’t be a problem I hope.

Share

Slides of Presentation “C++11 (C++0x) in Visual C++ 2010″

A couple of months ago, I gave a presentation about C++11/C++0x features supported in Visual C++ 2010 for software engineers at my company. You can now download the slides.

Share

Visual Studio 2010 Service Pack 1

Microsoft has released Visual Studio 2010 Service Pack 1.
MSDN subscribers can download it right now.
It will be publicly available on 10th of March.
See Soma Segar’s blog for details on what is included/changed with SP1.

Share

Introduction to the Standard Template Library

Stephan T. Lavavej (aka STL :) ) from Microsoft has created a series of Channel 9 video presentations discussing several aspects of the STL. They serve as a very good introduction to using the Standard Template Library.

I found them very interesting :)

Share

The New MFC Animation API

Introduction

Microsoft Visual Studio 2010 Service Pack 1 includes a number of enhancements and new features for MFC developers. One of those changes is an animation API to make it easy for you to create animations in MFC applications. This article will briefly introduce this animation API.
This articles was also posted on Codeguru.com.
Read the rest of this entry »

Share

Visual Studio 2010 SP 1 Beta

Microsoft has released Visual Studio 2010 SP1 Beta. It’s available right now for MSDN subscribers and will be available to everyone on Thursday.

It includes a new help viewer that I mentioned in my previous blog entry and “Win7-specific MFC APIs to support use of Direct2D, DirectWrite, and Windows Animation Technologies”. I can’t wait to try those out :)

Get more details here.

Share

Technical Editor for “Ivor Horton’s Beginning Visual C++ 2010″

I was technical editor for the book “Ivor Horton’s Beginning Visual C++ 2010“, published by Wiley. According to the author:

I would particularly like to thank my technical editor, Marc Gregoire, for doing such an outstanding job of reviewing the text and checking out all the code fragments and examples in the book. His many constructive comments and suggestions for better ways of presenting the material has undoubtedly made the book a much better tutorial.

Below is a description of what you can expect from the book.

By following author Ivor Horton’s accessible tutorial approach and detailed examples you can quickly become an effective C++ programmer. Thoroughly updated for the 2010 release, this book introduces you to the latest development environment and teached you how to build real-world applications using Visual C++. With this book by your side, you are well on your way to writing applications in both versions of C++ and becoming a successful C++ programmer.

Ivor Horton’s Beginning Visual C++ 2010:

  • Teaches the essentials of C++ programming using both of the C++ language technologies supported by Visual C++ 2010.
  • Shares techniques for finding errors in C++ programs and explains general debugging principles.
  • Discusses the structure and essential elements that are present in every Windows application.
  • Demonstrates how to develop native Windows applications using the Microsoft Foundation Classes.
  • Guides you through designing and creating substantial Windows applications in both C++ and C++/CLI.
  • Features numerous working examples and exercises that help build programming skills.
Share

Microsoft Visual Studio 2010 and .NET Framework 4 Released

Today, Microsoft released Visual Studio 2010 and the .NET Framework 4. A lot of new features are included. One of them is a completely new editor.

“Visual Studio 2010 and .NET Framework 4 have something for every developer. The new editor, now using Windows Presentation Foundation, delivers a more flexible, feature-rich environment that supports concepts such as the use of multiple monitors. This enables a developer to have one monitor with code, another with the user interface designer, and yet another with database structure.”

Visual C++ 2010 also includes a lot of new features, some of them are:

  • MSBuild and multi-targeting
  • IntelliSense and Browsing (#include auto completion, call hierarchy, red squiggles, find all references, class wizard)
  • C++ compiler changes (static_assert, auto keyword, lambda, decltype, rvalue references)
  • Ribbon designer
  • Deployment changes
  • Task dialog support
  • Restart manager support

Read the full press release here or watch the keynote.

Later this week, Silverlight 4 will also be released to the web (RTW). At that time, an update for Visual Studio 2010 will also become available that will allow you to develop applications using Silverlight 4.

Share

Overview of New Features in Visual C++ 2010

A friend of mine, Marius Bancila, wrote several blog posts with details about new features in Visual C++ 2010.

He touches the following features:

  • MSBuild and multi-targeting
  • IntelliSense and Browsing (#include auto completion, call hierarchy, red squiggles, find all references, class wizard)
  • C++ compiler changes (static_assert, auto keyword, lambda, decltype, rvalue references)
  • Ribbon designer
  • Deployment changes
  • Task dialog support
  • Restart manager support

You can read his posts here. They give you a good idea of new features in VC++ 2010 :)

Share

Breaking Change for RValue References in Visual Studio 2010 RC

The Release Candidate of Visual Studio 2010 has changed the behaviour of RValue references slightly compared to the implementation in the Visual Studio 2010 beta versions. This is because the C++0x standard commitee has changed the RValue reference feature a bit and Visual Studio 2010 RC has incorporated those standard changes. Unfortunately, this might lead to compiler errors when you try to build code that is following the old standard. Let me give an example. Previously using a beta version of Visual Studio 2010 that was using the old C++0x standard, the following code would compile without any problems.

#include <iostream>
using namespace std;
// Increment value by 1 using RValue reference parameter.
int increment(int&& value)
{
   cout << "value = " << value << endl;
   value++;
   return value;
}
int main()
{
   int a = 10;
   int b = 20;
   // Increment a
   int result = increment(a);
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   // Increment b
   result = increment(b);
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   // Increment an expression
   result = increment(a + b);
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   // Increment a literal
   result = increment(3);
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   return 0;
} 

However, when trying to compile this using the latest release candidate of Visual Studio 2010, you will get the following errors:

rvalue_test.cpp(18): error C2664: 'increment' : cannot convert parameter 1 from 'int' to 'int &&'
          You cannot bind an lvalue to an rvalue reference
rvalue_test.cpp(21): error C2664: 'increment' : cannot convert parameter 1 from 'int' to 'int &&'
          You cannot bind an lvalue to an rvalue reference

These are related to the lines that are trying to increment a and b. Incrementing an expression or a literal still works as before. To get rid of those errors, you need to convert the lvalue to an rvalue. You can use the std::move function for this as shown in red below.

#include <iostream>
using namespace std;
// Increment value by 1 using RValue reference parameter.
int increment(int&& value)
{
   cout << "value = " << value << endl;
   value++;
   return value;
}
int main()
{
   int a = 10;
   int b = 20;
   // Increment a
   int result = increment(std::move(a));
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   // Increment b
   result = increment(std::move(b));
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   // Increment an expression
   result = increment(a + b);
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   // Increment a literal
   result = increment(3);
   cout << "  a=" << a << ", b=" << b << ", result=" << result << endl;
   return 0;
}

This now compiles without any errors and produces the following output:

value = 10
  a=11, b=20, result=11
value = 20
  a=11, b=21, result=21
value = 32
  a=11, b=21, result=33
value = 3
  a=11, b=21, result=4

Now, it again works as expected :)

Share

Visual Studio 2010 Licensing White Paper

Microsoft has released a white paper for Visual Studio 2010 licensing which provides an overview of the complete Visual Studio 2010 product line. The paper also gives a number of example deployment scenarios and the licensing requirements for those.

Client editions in the Visual Studio 2010 product line include:

  • Microsoft Visual Studio 2010 Ultimate with MSDN
  • Microsoft Visual Studio 2010 Premium with MSDN
  • Microsoft Visual Studio 2010 Professional with MSDN
  • Microsoft Visual Studio Test Professional 2010 with MSDN

(Visual Studio 2010 products can be purchased without an MSDN subscription in certain channels.)

Server products in the Visual Studio 2010 product line include:

  • Microsoft Visual Studio Team Foundation Server 2010
  • Microsoft Visual Studio Lab Management 2010

Volume licensing customers who need a definitive guide to licensing terms and conditions should reference the Microsoft Licensing Product Use Rights (PUR) and applicable licensing agreements. For retail customers, the license terms are specified in the End User Licensing Agreement (EULA) included with the product.

Share

Visual Studio 2010 and .NET Framework 4 Release Candidate

Microsoft has released the Release Candidate version of Visual Studio 2010 and the .NET Framework 4.

See Scott Guthrie blog post about it.

Right now it’s available for MSDN subscribers.
On Wednesday 10th of February everyone will be able to get their hands on it :)

Two important things to know (from Scott Guthrie blog post):

  • If you have previously installed VS 2010 Beta 2 on your computer you should use Add/Remove Programs (within Windows Control Panel) to remove VS 2010 Beta2 and .NET 4 Beta2 before installing the VS 2010 RC.  Note that VS 2010 RC can be installed on the same machine side-by-side with VS 2008 and VS 2005.
  • Silverlight 3 projects are supported with today’s VS 2010 RC build – however Silverlight 4 projects are not yet supported.  We will be adding VS 2010 RC support for SL4 with the next public Silverlight 4 drop. If you are doing active Silverlight 4 development today we recommend staying with the VS10 Beta 2 build for now.
Share

Visual Studio 2010 and .NET Framework 4 Beta 2

Visual Studio 2010 and .NET Framework 4 Beta 2 are now available. The final version is scheduled for 22nd of March 2010. I’m looking forward to it :)

For Visual C++ developers there are lots of new things to look forward to, like parallel programming, MFC ribbon resource editor, easy application local deployment model etc etc…

When you use the .NET Framework you will apparently be able to have deployments with up to 81% reduction in the framework size by using the Client Profile.

According to the press release:

“The company also outlined a simplified product lineup and pricing options for Visual Studio 2010 as well as new benefits for MSDN subscribers, including the Ultimate Offer, available to all active MSDN Premium subscribers at the official product launch on March 22, 2010.”

The product lineup is simplified with the following versions:

  • Microsoft Visual Studio 2010 Ultimate with MSDN. The comprehensive suite of application life-cycle management tools for software teams to help ensure quality results from design to deployment
  • Microsoft Visual Studio 2010 Premium with MSDN. A complete toolset to help developers deliver scalable, high-quality applications
  • Microsoft Visual Studio 2010 Professional with MSDN. The essential tool for basic development tasks to assist developers in implementing their ideas easily

Download Beta 2 now.

Read the full Microsoft press release.

Share

Parallel Pattern Library (PPL) in Visual C++ 2010

Visual C++ 2010 comes with a brand new library called the Parallel Pattern Library or PPL. It is a powerful library that makes writing parallel code easier which is getting more and more important with the current and upcoming multicore CPUs. This article will give an overview of the PPL. Read the rest of this entry »

Share

MFC Restart Manager Support in Visual C++ 2010

Windows Vista introduced the restart manager. It is used to automatically restart an application after it crashes. It can also be used to restart application after a reboot by a Windows Installer or update. If you create a new MFC application using the project wizard in Visual C++ 2010, you will automatically get support for the restart manager. If you want to add support to an existing MFC application, you only need to add 1 line of code to the constructor of your CWinApp or CWinAppEx derived class. Read the rest of this entry »

Share

CTaskDialog in MFC in Visual C++ 2010

Windows Vista introduced the concept of Task Dialogs. Those are a powerful replacement for the standard message boxes. Read the rest of this entry »

Share

SafeInt in Visual C++ 2010

The SafeInt library is a new addition to Visual C++ 2010. It allows you to safely perform arithmetic operations on integers ranging from 8-bit to 64-bit. The SafeInt library will automatically detect arithmetic overflow or divide by zero. Using the SafeInt library is pretty easy. The following piece of code uses the SafeInt library to safely calculate the addition of two 8-bit integers. Read the rest of this entry »

Share

‘auto’ Keyword in Visual C++ 2010

Starting with Visual C++ 2010, the ‘auto’ keyword has a different meaning. Auto is now used as a variable type and it instructs the compiler to figure out the exact type itself. This makes it much easier to define function pointers or to iterate over vectors for example. This post will give a brief overview of how to use the ‘auto’ keyword. Read the rest of this entry »

Share

The ‘Move Constructor’ in Visual C++ 2010

A new feature in Visual C++ 2010 is called Rvalue References. This is a feature from the C++0x standard. One thing that Rvalue References can be used for is to implement move semantics for objects. To add move semantics to a class, we need to implement a move constructor and a move assignment operator (optional). This article will briefly explain the benefits of move constructors and how to write them. Read the rest of this entry »

Share