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/Save/Bookmark

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/Save/Bookmark

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/Save/Bookmark

Microsoft Office 2010 Beta

Microsoft has just released a beta version of Office 2010.

The following programs are available in this beta version:

  • Word
  • PowerPoint
  • Outlook
  • Excel
  • OneNote
  • Access
  • Publisher
  • InfoPath
  • SharePoint Workspace
  • Communicator

Separately available beta programs are:

  • Microsoft Visio 2010
  • Microsoft Project 2010

Get all the details.

  • Share/Save/Bookmark

Trip to Budapest Photo Album

I’m just back from another small trip to Budapest, just 2 days.

I have uploaded some pictures of the trip. See them here. Enjoy :)

  • Share/Save/Bookmark

Happy New Year 2010

2010

Happy New Year
Sretna Nova Godina
Gelukkig Nieuwjaar
:)

  • Share/Save/Bookmark

Axialis Black Friday till Cyber Monday Promotion

I’m a big fan of Axialis IconWorkshop. A while ago I wrote a small review of it which you can find here.

It seems Axialis is having a special promotion this weekend. From Black Friday until Cyber Monday you get 50% discount on all products. Find out more.

  • Share/Save/Bookmark

Trip to Warsaw Photo Album

Last week I was in Warsaw (Poland) on a business trip. Unfortunately, I didn’t have much time to go see things because it was already dark after work. However, I did try to take some pictures. You can see them here.

  • Share/Save/Bookmark

Trip to Tokyo Photo Album

In October 2009 I went to Tokyo with some friends for a week.

Some pictures of the trip can be seen in a new photo album. :)

  • Share/Save/Bookmark

Trip to Panama Photo Album

In September 2009 I went to Panama with KrisKras.

I have created a photo album about the trip. See it here. Enjoy :)

  • Share/Save/Bookmark

Trip to Budapest Photo Album

In August 2009 I went to Budapest for a short city trip with some friends.

I have uploaded some pictures to a photo album. See them here. Enjoy :)

  • Share/Save/Bookmark

Trip to Prague Photo Album

In June 2009 I went to Prague for a city trip with a few friends. I already posted a few pictures on my blog in this post.

I finally uploaded a few more pictures to a photo album. See them here. Enjoy :)

  • Share/Save/Bookmark

Windows 7 breaks all pre-order records at Amazon

Apparently the pre-order of Windows 7 went extremely well. According to Amazon UK, they sold more Windows 7 pre-orders in the first 8 hours of its release than Vista did during it’s entire pre-order period.

According to Brian McBride, Amazon UK MD:

“The launch of Windows 7 has superseded everyone’s expectations, storming ahead of Harry Potter and the Deathly Hallows as the biggest grossing pre-order product of all-time at Amazon.co.uk, and demand is still going strong. Over the past three months, only Dan Brown’s The Lost Symbol has sold more copies than Windows 7, which is an incredible achievement for a software product.”.

Tomorrow is the official launch date of Windows 7 :)

  • Share/Save/Bookmark

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/Save/Bookmark

Access Hidden Regional Themes in Windows 7

I just came across an interesting blog post.

Apparently, Windows 7 comes with several regional themes which include wallpapers from Canada, Australia, South Africa, and Great Britain. You can easily activate those themes following the procedure in the following blog post.

Access Hidden Regional Themes in Windows 7

  • Share/Save/Bookmark

Windows 7 E Cancelled

It seems Microsoft will not release a Windows 7 E for the European Union after all. Windows 7 E was planned for the EU to be a Windows 7 version without Internet Explorer. Now, Microsoft will implement a ballot screen that will be shown the first time a user starts Internet Explorer. That ballot screen gives the user the option to select a different browser like Firefox, Safari, Chrome, Opera and so on.

  • Share/Save/Bookmark

More Pictures of Miami 2009 Trip

In March 2009, my brother and me went to Miami on holiday.
I had already posted some pictures on my blog in the “Back from Miami, Steak and Whiskey” and “Holiday in Miami :) ” posts.
We now have uploaded a lot more pictures. See them here. Enjoy :)

  • Share/Save/Bookmark

Wallpaper Cycler 3.6.0.180 Released

Finally, Wallpaper Cycler 3.6.0.180 has been released today :)

Wallpaper Cycler 3.6.0.180 has a lot of new features and bug-fixes. Some of the major new features include:

  • Full High DPI support.
  • Support for Windows 7.
  • Support for 64 bit Windows.
  • Automatically rotate JPEG images based on camera orientation.
  • Option to manually rotate individual wallpapers.
  • Automatically assign a default tag to new wallpapers.
  • Option to automatically rerender the wallpaper on resuming from standby or hibernate.
  • New option “Cycle wallpaper when display settings changed”.
  • Folder synchronization will detect new folders.
  • More advanced Preview Window.
  • New Wallpaper Cycler Controller tool.
  • New Info Panel replaces the old Information Bar.
  • Align images inside wallpaper objects on layouts.
  • Layout objects now have an option ‘visible’.
  • High color toolbar images and menu images.
  • Multithreaded rendering.
  • New HTML renderer for text objects in layouts.
  • Option to generate only sensible aspect ratio tags.
  • Layout changes in the editor can now be discarded.

Get a full list of all the changes.

  • Share/Save/Bookmark

Trip to Prague

A few pictures from my city trip to Prague in the Czech Republic. The last picture is taken in Kutná Hora, a small town near Prague and a UNESCO World Heritage site.

(Note: all pictures are copyrighted by me, Marc Gregoire. Please contact me if you want to use one.)

  • Share/Save/Bookmark

Wallpaper Cycler: Bug Fixes and New Features

The following new features have been implemented in Wallpaper Cycler:

  • The text editors now have an extra button to insert a line break without a visible horizontal line.
  • The Info Panel now contains a “Set As Wallpaper” button in the upper right corner to make it easier to render the selected wallpaper to the desktop.
  • Wallpaper Cycler will now by default store the rendered wallpaper in “C:\Users\<username>\AppData\Roaming\NuonSoft\WallpaperCycler” or similar depending on the language of your Windows and whether you are running XP, Vista or Windows 7. Previously WPC would store the image in the user temp folder, but some tools cleanup the temp folder causing a plain colored background to appear on the next reboot of Windows.
  • An “Options…” menu item in the Wallpaper Cycler notification icon menu.
  • The fullscreen preview now shows a ‘(Image x of y)’ in the lower left wallpaper information block.

I made the following bug fixes for Wallpaper Cycler:

  • libexif.dll would sometimes crash with certain jpg files.
  • The yellow error message that appeared in the screensaver when WPC was not running was not moving around the screen anymore.
  • When folder synchronization adds new folders (= new categories) to disabled categories, the new categories are also disabled.
  • Rerendering of the wallpaper in the Lite version of Wallpaper Cycler would not always happen in a low priority thread.
  • When all categories were disabled, the “Start Cycling” button would be disabled, now it’s enabled and a warning will be shown when you press it to explain why cycling cannot start.
  • When a cycle was skipped due to CPU usage (when CPU monitoring is enabled), the timer would freeze.
  • Screensaver didn’t work on some systems.
  • When cycling to the next file based wallpaper, WPC will first check if the file still exist. If it doesn’t exist it will automatically cycle again. It will try this for 10 times after which an error message is shown with a suggestion on how to cleanup the list.
  • When the WPC screensaver was enabled, opening the Windows Screensaver control panel was pretty slow.
  • WPC will remember the old screensaver and when disabling the WPC screensaver it will restore this old screensaver. Previously, it also happened that WPC would remove any screensaver that was configured in Windows, this should also not happen anymore.
  • The option regarding hand-cursors in Options > Program Settings > Desktop has been rewritten a bit to make it more clear what is meant.
  • In the startup settings delay times for <Rerender on startup delay> and <Delay load last WCL at startup> now clearly mention that those are in seconds.
  • The words “tray icon” and “system tray” have been changed to descriptions based on “notification area” according to the Windows UI guidelines.
  • The main window could be resized too small when running in very high DPI (150%).
  • “error while create DIBSection in CWCL::RenderWallpaperWithLayout” appeared when Windows was waiting on the Switch User screen and WPC wanted to cycle the wallpaper.
  • After returning from screensaver or locked desktop, the timer of Wallpaper Cycler sometimes didn’t count down anymore.
  • Windows Gadget was not displaying correctly on Windows 7.
  • Height of new tray icon has been increased with 1 pixel.
  • The hotspots in the Info Panel kept working even when no wallpaper was selected in the main list.
  • When you have a ‘Give Tags’ hotkey assigned to open the tags menu for the selected wallpapers, it will now show a thumbnail in the menu when only 1 wallpaper is selected. This also works in the fullscreen preview window.
  • When the Give Tags menu opened, the main window or fullscreen preview doesn’t lose focus anymore.

I’m also happy to announce that I’m currently working on updating the website and preparing for finally releasing the 3.6 release :)

  • Share/Save/Bookmark