MVP Global Summit 2011

The MVP Global Summit 2011 took place in Redmond and Bellevue at the beginning of March. This year I attended for the fifth time, and as usual it was a great time. Fellow MVPs, discussions with the Microsoft product groups, parties, everything made it worth it. And this year it was also a little bit…

Parallel Programming for C++ Developers

Channel9 recently posted a video with the Parallel Computing Concurrency Runtime team talking, mainly, about tasks and continuations, new features to the Parallel Patterns Library. These are already available through the ConcRT Extra’s Sample Pack. You can watch the half hour interview with the team here. Besides the new stuff they shown, I particularly liked…

Finding If a Computer Is a Laptop

I’ve ran recently across this question: how to find (using C++) if a computer is a laptop? That is possible with WMI and many answers (such as this) point to the Win32_SystemEnclosure class. This class has a member called ChassisTypes, which is an array of integers indicating possible chassis types. At least one of them…

32-bit and 64-bit COM Servers

It is possible to register both 32-bit and 64-bit versions of the same COM server on 64-bit machine. This leads to several questions such as how are they registered and which one of the two is used. I will try to answer them below. But first, let’s start with an example. Example Let’s say we…

Colors Game Redux

Two days ago I posted a simple implementation of a game of colors. Though it was intended only as an exercise, someone has criticizes the use of an int** to hold the grid information, mainly for two reasons: the footprint on 64-bit platforms can get nasty the explicitly allocated memory, instead of using a std::vector…

Visual Studio 2010 changes for VC++ (part 3)

Some of the important changs in Visual Studio 2010 in regard to VC++ are represented by the support in the C++ compiler of some of the features already approved for the new C++ standard, so far called C++0x. In this post I will give a short overview on then. static_assert I already wrote a post…

Interface Implementation in C#

I recently found a piece of code that can be summarized by the following sample:

As you can see there is an interface I that has two methods, F1 and F2. A is derived from X, that has a method F2, and also implements I, but only contains F1. I was puzzled at first,…

Using ColorMatrix for Creating Negative Image

.NET provides two classes for image transformations: Matrix, used for geometric transformations, and ColorMatrix, used for color transformations. One of such color transformations is inverting or negating. This means subtracting each color component from 255. Black (0,0,0) becomes White (255, 255, 255), and Green (0, 255, 0) becomes Magenta (255, 0, 255). You can find…

DotNetZip Library

.NET 3.0 provides some support for working with ZIP files. However, it has an important drawback: it only works for packages that are conformant to the Open Packaging Convention standard. Most of the ZIP files are not. Codeplex features a library called DotNetZip that provides support for packing and unpacking in C#, VB.NET or any…

File Dialog with Custom Controls

Sometimes you want to customize a file dialog, maybe to provide a preview for images or files in general. Fortunately, the common file dialog can be easily extended to achieve this. I will explain in this post how to do that. There are several things one needs to do to extend the file dialog. First…