Visual Studio “14” CTP ships with a refactored C Runtime. The first thing you’ll notice is that msvcrXX.dll has been replaced by three new DLLs: appcrtXX.dll, desktopcrtXX.dll and vcruntimeXX.ddl (where XX stands for the version number so in this version it’s appcrt140.dll, desktopcrt140.dll and vcruntime140.dll).

You can see in this image that both desktopcrt140.dll and vcruntime140.dll depend on appcrt140.dll.

These three new DLLs export run-time routines in different categories, with some of them overlapping, as shown by the bellow table (assembled by directly analyzing the exports of the three modules).




Buffer Manipulation
Byte Classification
Character Classification
Console and Port I/O
Data Alignment
Data Conversion
Debug Routines
Directory Control
Error Handling
Exception Handling
File Handling
Floating-Point Support
Low-Level I/O
Process and Environment Control
Searching and Sorting
Stream I/O
String Manipulation
System Calls
Time Management

Breaking CRT routines in several DLLs is not the only change. The CRT has been rewritten for safety and const correctness. Many of the routines have been re-written in C++. Here is a random example: the _open function, that was available in open.c was implemented like this in Visual Studio 2013:

In Visual Studio “14” CTP it is available in function appcrt\open.cpp and looks like this:


To read more about the refactoring see the VC++ team’s blog posts:

, , , , Hits for this post: 35333 .

Microsoft has announced that Visual Studio 2012 Update 2 will bring support in Visual Studio and TFS for git. They already used git on codeplex and this move shows how popular git has become. I don’t work much with git, but as I said codeplex uses git, and I used it for working on cpplinq. However, the experience with Git Source Control Provider extension for Visual Studio was not the most pleasant. Fortunately, Visual Studio Tools for Git is a different story, allowing you to work exclusively from Visual Studio, without the need of addition tools. After giving it a try, I must say that even if it’s in CTP and still has some issues, it’s a totally different story than the previous extension or external tools I used. However, support for git will not be added to the previous versions of Visual Studio.

Here is more about the support for git:

Before you can start working with git, you need two things:

  1. Visual Studio 2012 Update 2 CTP 2
  2. Visual Studio Tools for Git

Extensions manager

In this post I’ll show what it takes to clone a git repository, work on the project, commit and push the changes on the remote branch.

To clone a repository you have go to Connect to Team Projects in Team Explorer, and under Local Git Repositories use the Clone pane to enter the URL of the server repository and the local destination. After the repository has been cloned, it shows up in the list, as shown below.

Cone a git

You can change the settings, such as your credentials from the Settings pane.

Git settings

To view your changes you can use the Git Changes > Commits pane. You can see included and excluded changes, and also untracked files. To commit your changes, provide a description (mandatory) and hit the Commit button. The page updates after the commit finishes.

Committing changes

It is possible to view the changes on each file with the built-in tools:

source file diff

After you committed all your changes and you’re ready to publish them on the server you can push the ongoing commits. If there are changes on the server, you must first pull those changes, merge locally, commit again and then push.

push ongoing commits

You can view the history for an entire branch from Team Explorer > Git Changes > Branches

Branch history

or for a single file from Solution Explorer (it is also possible to compare two versions).

File history

, , , Hits for this post: 41446 .

Microsoft has made available the release candidates for the new Windows and the new Visual Studio tool set. Some of the products have been renamed:

  • Windows Server 2012 is the new name for Windows 8 “Server”
  • Visual Studio 2012 is the new name for Visual Studio 11

MSDN subscribers can download them from their account. If you’re not a subscriber you can use the following links:

You can read more about these releases here:

The only thing I’d like to mention at this point is that after butchering the Windows logo (no, I don’t believe in the ingenuity of the light blue rectangle) someone felt the need to do the same with the Visual Studio logo. And if I could live with the new Windows logo (the color is awful) the new Visual Studio logo is huge failure, in my opinion.

Yes, that’s right, the one in the right is the new VS2012 logo.

After seeing the things Microsoft has done to Windows and Visual Studio UI (especially the colors in Windows that knock you in the head and, the opposite, the lack of colors in VS) it looks like all UI experts left to Apple.

, , , , , Hits for this post: 44581 .

Visual Studio 11 Beta was made available today (See Jason Zander’s announcement). It can be downloaded from here. These are my first impressions after downloading and trying it.

The New UI
I have already talked about the new Chrome theme. I find it awful, you don’t know what’s enabled and what is not. I wish they change it, and at least give us the possibility to opt for this theme or the classic colored theme.

Startup time
It takes Visual Studio 2010 about a whole minute to start on my machines, so I didn’t have great expectations for Visual Studio 11. However, I am impressed with the startup time, which is about 3 seconds. Excellent.

Opening projects created with a previous version
When I opened a solution build with VS2010 it did not prompt me the classic question about upgrading to the new version. That’s because the project file schemas were not changed between VS2010 and VS11. This is the first time this happens. As for the solution file, it just updated the format version without prompting for anything.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 11

Quick launch window
The first thing I do when I install Visual Studio is changing the fonts. But sometimes finding such windows or commands is cumbersome. A new window called Quick launch is now available in the top right corner. You can type for commands and it searches through menus, options, tool windows, etc. displaying a list of results. When you press on a result it executes the command.

Solution Explorer
This is now a hub for functionality previously available in Solution Explorer, Class View, Object Browser, Call Hierarchy, Navigate To, and Find References tool windows.


You can search in the solution explorer, view the call graph, hierarchy types etc. As you do this it creates new views kept in a stack. It is possible to navigate between these views with two buttons, Back and Forward that are available in the left side of the Solution Explorer toolbar.

The other buttons are:

  • Home: brings back to the home view of the solution explorer
  • Collapse all: collapses all the items in the Solution explorer three view
  • Sync with Active Document
  • Preview selected items: when this is enabled, as you select files in the tree they are displayed in a special document window, docked on the left of the documents bar. This is excellent because it helps viewing the file (or a method in a file) immediately, yet without opening lots of files (since they are all displayed, one at a time, in the same document window).
  • Properties: opens the properties window for the current item
  • Show all files: as in previous versions
  • View class diagram: shows the class diagram (or creates a new one if one does not exist) for the current item
  • Create a new window containing a copy of the content of this window: this duplicates the solution explorer window, just in case you want multiple views

If you want to quickly find something in the solution explorer, you can use the search control. As you type, the content is filtered to show only the elements that contained the type text. This includes source files, references, images and everything else in the tree.

Search and Replace
There is a new quick window for search and replace. This window is displayed in the top-right corner of the active document window. This window is specific for each document; when you switch to another document, it closes.

It is possible though to open the classic window, which looks like this:

Symbol selection
A nice IntelliSense feature is highlighting in the entire document the symbol under the cursors selection. This helps a lot figuring where else in the code the symbol is used. And also helps when you have variables with the same name in different scopes, because it only highlights the symbols that are visible in the scope of the block where the cursor is.

References Window
The window for adding references has also been redesign. You can see a list of the available components that can be referred. As you hover the mouse over them a check box is displayed on the left, so you can check that component for being added.

NuGet Package Manager
For .NET projects a NuGet package manager is available. You can open it from context menu for the solution or the project.

It opens a dialog where you can search for packages, install, update or remove.

XML Doc comments for VC++
A great feature that was finally added for VC++ is XML doc comments. You can add them to C++ types and methods and generate XML doc files. For generating the output file the /doc switch must be set.

For this sample

The following output file was generated:

The gotcha is that so far it does not work in the automatic way as for C# or VB.NET. When you type /// it does not automatically generate the stubs, you have to add everything manually.

You can use these files to generate MSDN-style documentation using for instance the Sandcastle compiler.

Additional readings

, , , Hits for this post: 40761 .

Dear Microsoft,

I have recently read the two blog posts about the new “developer experience” with Visual Studio 11 (part 1 and part 2). I don’t have the IDE yet (since the beta will be made available on February 29), but from the blog posts I see that you once again changed the look and feel. Why do you have to do this all the time? Can’t you sell a new version without redesigning the UI? We don’t get used well with a version and you change the game again. And like it wasn’t bad enough to do such a big changed, you decided to go with a chrome theme. This is what I call “Windows disabled”; you can’t get a good feeling of what is enabled and what is not. Everything is in tones of gray and confusing.

Why do you have to invest all that time in redesigning the UI with each release? Why don’t you focus on making the current UI more responsible (for instance VS2010 takes 1 minute on my machines to start) and less buggy? Why don’t you invest that time in building features that make our lives easier? Like providing multiple windows for search results (not just two) or supporting auto completion (like it was in all versions until VS2010) in the folder selection fields in the New Project dialog?

So dear Microsoft, please

  1. make it possible for us to change the Chrome theme to the old colored theme
  2. don’t change the UI with each version

A concerned developer

PS: I still can’t get out of my mind the horror or scrolling with the mouse on Windows 8 maybe 5 screens of colorful tiles to get to the app that I want to launch. Awful! As it stands I see big failures on the horizon.

, , , , Hits for this post: 39942 .

Visual Studio 11 brings many new things for native development, including support for new features from C++11 (unfortunately not all), or ability to write Metro apps with C++/CX including modeling the UI with XAML. In this post I will talk a bit about three favorite features that I noticed immediately after trying VS11 from Windows 8 Developer Preview.

Use of namespaces
Finally, I see namespaces promoted in native code. Yes, it’s C++/CX and they were probably forced to use namespaces for a consistent experience from the various languages that target the Windows Runtime, but it’s a very nice change to the default templates for C++ projects where everything is put in the global namespace. I can only hope they will improve that in this version or the next for standard C++ applications (whether Win32 console apps or MFC apps).

UPDATE: looks like I wasn’t clear enough, I’m not saying namespaces is a new C++ feature (duh), I’m saying Visual Studio templates for C++ don’t promote that. Create a Win32 project, an MFC project, and ATL project, there are no namespaces. You’d have to code everything manually, but if you do it, you mess the wizards. So, what I’m saying is that I hope we can see namespaces promoted for other project and item templates too.

Partial classes
I already wrote about partial classes, but I want to reiterate this feature. Partial classes gives you the ability to define a class in several files. This is great because developers and code generator tools such as designers can edit different parts of the same class without interfering one with the other. This feature made it possible for supporting XAML user interfaces in C++/CX Metro applications.

I’m actually wondering why isn’t this already part of standard C++ and I can only wish that the next version (which hopefully will not take another decade to conclude) will include this feature.

Better Syntax Highlighting
Below is a comparison for the same piece of code highlighted by Visual Studio 2010 on the left, and Visual Studio.vNext (11) on the right.

There is hardly any formatting in VS10. However, on the other hand, the highlighting in VS11 is beautiful. User defined types (including library types) are displayed with another color than the built-in types (such as int), including in their definition. STL types (string, vector, etc.) are finally identified as types and displayed with the appropriate color. Also the name of parameters is displayed in italics which makes them easily identifiable. There are other things about the highlighting, but these striking changes.

, , , , , , Hits for this post: 53412 .

If you tried the Win8 Developer Preview and built WinRT components (native or managed) you noticed the .winmd files. The name stands for Windows Meta Data and the format of these files is the same used by the .NET framework for the CLI, i.e. ECMA-335. That means you can actually read these files with a tool such as ILDASM or Reflector, or of course, through .NET Reflection.

If you look in C:\Windows\System32\WinMetadata folder you’ll find the WinMD files for the Windows Runtime. You can browse the content of these files with one of the aforementioned disassemblers.

Here are two dummy WinRT components, one developed in C++/CX and one in C#.

Native WinRT component in C++/CX Managed WinRT component in C#

In the case of the native component, the output includes a DLL and a WINMD file (and of course a PDB file). In the case of the managed component, the output is either a DLL only or a WINMD only (plus the associated PDB file), depending on the Output type as defined in the project properties. If the type is Class Library the output is a DLL; this is enough if your component is supposed to be consumed from a managed language. However, if the component should be consumed from C++/CX or Javascript, then the project type must be set to WinMD File. In this case the DLL is replaced by a WinMD file, that contains, at least in the current version, both the matadata (as implied by the name) and the implementation.

Native WinRT component in C++/CX Managed WinRT component in C#

It should be possible to use reflection with winmd files. However, the reflection capabilities of .NET 4.5 in this developer preview seem to be very limited. The only available Load method in the Assembly class is

Trying to load the winmd file fails with a FailLoadException with the message “Could not load file or assembly ‘Winmdreflection, ContentType=WindowsRuntime’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)”.

It is possible though to read information for the types described in an winmd file in native code using the IMetaDataImport/IMetaDataImport2 COM interfaces. You can find an example here. But this has the drawback that you have to instantiate an object first and then query for its type information.

To use a Windows Runtime component in a Metro application (managed or native) you have to add a reference to it. That is pretty straight forward. In the following example I’m adding a reference in a C++ Metro application to the two WinRT components, one native and one managed, shown earlier. To do this, you can go to the project’s property page and open the Common Properties > Frameworks and References page, or use the References command from the project’s context menu which opens that page directly. You can add a reference to a project from the same solution, to a Windows component or you can browse for the winmd file.

Having done that you can instantiate the WinRT components.

, , , , , , , Hits for this post: 95888 .

Windows Runtime, or shortly WinRT, is a new runtime (siting on top of the Windows kernel) that allows developers to write Metro style applications for Windows 8, using a variety of languages including C/C++, C#, VB.NET or JavaScript/HTML5. Microsoft has started rolling out information about Windows 8 and the new runtime at BUILD.


WinRT is a native layer (written in C++ and being COM-based) that is intended as a replacement, or alternative, to Win32, and enables development of “immersive” applications, using the Metro style. Its API is object oriented and can be consumed both from native or managed languages, as well as JavaScript. At the same time the old Win32 applications will continue to run just as before and you can still (and most certainly will) develop Win32 applications.

Microsoft has created a new language called C++ Component Extension, or simply C++/CX. While the syntax is very similar to C++/CLI, the language is not managed, it’s still native. WinRT components built in C++/CX do not compile to managed code, but to 100% native code. A good news for C++ developers is that they can use XAML now to build the UI for immersive applications. However, this is not available for classical, Win32 applications.

You can get a glimpse of the new system and the tools by downloading and installing the Windows Developer Preview with tools, that includes the following:

  • 64-bit Windows Developer Preview
  • Windows SDK for Metro style apps
  • Microsoft Visual Studio 11 Express for Windows Developer Preview
  • Microsoft Expression Blend 5 Developer Preview
  • 28 Metro style apps including the BUILD Conference app

Notice this is a pre-beta release and you might encounter various problems.

Before you start here are several additional articles that you might want to read:

There are also several new forums available on MSDN forums for developing Metro style applications, which you can use for addressing technical questions. Hopefully thee will be answers from Microsoft people working in this area.

, , , , , , , , , Hits for this post: 82146 .

I was doing some development in Visual Studio 2010 Beta 2 and I had to add some references to my projects. When I opened the Add Reference dialog I realized something was wrong: it was working very fast. Since I’m using Visual Studio 2008 for every day development I am used to wait tens of seconds before the dialog loads all the references and only after that I can select what I want. But in Visual Studio 2010 it popped up instantly and all the tabs were browse able at the same speed. This was not normal. Usually new versions are slower that older ones (and I suspect Visual Studio 2010 has such features), but Add Reference dialog works great.

Then I browsed the web I came across this post from Scott Guthrie who explain what has changed:

  • default active tab when the Add Reference dialog is opened is now Projects, and not .NET
  • .NET and COM tabs load asynchronously in worker threads, populating the lists as references are discovered, without blocking the UI thread, which means you can browse through the references as soon as you open the tab

There are only two things that I can say: first is that I’m impressed. I now get instantly what it used to take maybe half a minute. Second is that I’m puzzled that it took so many years to implement that. Anyway, good work.

, , Hits for this post: 43730 .

With VC++ Feature Pack Microsoft has added new classes to MFC to provide support for new controls. However, these controls were not available from the designer. One had to manually wrote all the code for enabling an application to use these controls. Visual Studio 2010 Beta 2, released a couple of weeks ago, provides support in the designer for these controls.

MFC controls in the Toolbar

MFC controls in the Toolbar

Here is a screen shot of a dialog application with these controls:

New MFC Controls

New MFC Controls

The controls are:

  • Color button (CMFCColorButton): represent a color picker control allowing users to select a color
  • Font combo box (CMFCFontComboBox) : represent a combo control that displays a list of fonts available in the system
  • Edit browse (CMFCEditBrowseCtrl): an editable control with a button that displays a dialog for selecting a file or a folder
  • Visual Studio list box (CVSListBox): an editable list control with buttons for adding, removing or rearranging items in the list
  • Masked edit (CMFCMaskedEdit): a masked edit control that has a string template representing the structure of the allowed input, which is validated against the value provided by the user
  • Menu button (CMFCMenuButton): displays a pop-up menu (from a menu resource) and reports the command selected by the user
  • Property grid (CMFCPropertyGridCtrl): an editable property grid control
  • Shell list (CMFCShellListCtrl): a list control that displays the files and folders from you system just list Windows Explorer list view does
  • Shell tree (CMFCShellTreeCtrl): a tree control that displays the folder from your system just like the Windows Explorer folder view does
  • Link control (CMFCLinkCtrl): is a special button that has the appearance of a hyperlink and invokes the target link when pressed

Not all the properties for these controls are available from the designer. For instance the properties list still needs hand coding, it is not possible to select a menu resource for the menu button nor the starting point for the shell tree and list. However, having them available in the toolbar is a good step forward.

, , , , Hits for this post: 68075 .