Visual Studio 2010/11 Utilities

Here is a compilation of very useful utilities for VS 2010 and VS 11.
Note: Utilities with an asterisk (*) beside the name are not available to VS 11 yet.

CLIArgs Made Easy

http://www.ricardosabino.com/?p=214
CLI Args Made Easy (Command Line Arguments Made Easy) is an add-in that allow you to change the command line arguments of the startup project very easily by adding a combobox in the toolbar. It also saves all the arguments you insert for future use.

Debugger Canvas (*)

http://msdn.microsoft.com/en-us/devlabs/debuggercanvas.aspx
Debugger Canvas is a new user experience for the debugger in Visual Studio Ultimate. It pulls together the code you’re exploring onto a single pan-and-zoom display. Visual debugger and multithreading debugging goodies.

Productivity Power Tools (*)

http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef
A set of extensions to Visual Studio Professional (and above) which improves developer productivity. Very useful enhanced scrollbar, vertical tabs, quick find files, searchable references and editing tools.

ReSharper

http://www.jetbrains.com/resharper/
With unparalleled support for C#, VB.NET, XAML, JavaScript, XML, HTML, CSS, ASP.NET and ASP.NET MVC, including comprehensive cross-language functionality, ReSharper will help Visual Studio users write better code, easily examine and refactor existing code bases. A must have for anyone who’s doing C# code.

Visual Assist X

http://www.wholetomato.com/
Read, write, navigate, and refactor code FAST with more than 50 productivity-boosting features for C++/C, C#, VB, ASP, JavaScript. A must have for anyone who’s doing C++ code.

VisualHG (*)

http://visualhg.codeplex.com/
Mercurial Source Control Plugin for MS Visual Studio.

CLI Args Made Easy 2010 / 2012

Find the new CLIArgsMadeEasy version here.

 

Summary

Improved version of the CLI Args Made Easy for Visual Studio 2005 and 2008.
Visual Studio Add-in that puts the project’s command line arguments more accessible.

Description:

Command Line Arguments Made Easy (CLIArgsMadeEasy) is a Visual Studio Add-in that eases the access and change of the startup project’s command line arguments. Instead of having to go to project properties or instead of using the command window to run your program with different arguments, CLIArgsMadeEasy adds a field in the toolbar for you to edit and saves everything you enter. A button is also added that opens a console window in the project’s working directory or home directory (if there’s no working directory set for this project).

Features:

  • More stable and faster than it’s predecessor CLIArgsMadeEasy.
  • Rapidly change startup project’s command line arguments in toolbar.
  • Saves command arguments history per user per machine.
  • Open console window in working directory or project’s directory (if there’s no working directory set).
  • Easily set a new startup project in the toolbar.

Screen shot:

cliargs

Changelog:

  • v1.3 – fixed bug that prevented resizing the CLIArgs input box.
  • v1.2 – added new combo box to easily choose a new startup project.
  • v1.1 – fixed bug parsing solutions with projects inside project folders.

Note: to resize the add-in input boxes you can click on the toolbar options button on the right and choose: “Add or Remove Buttons”->“Customize”. Then select the input box you want to change and choose “Modify Selection” and set the width as you like.

Known limitations:

  • Doesn’t work with XBox 360 projects.

I’d really appreciate if someone could give me a hand to solve this problem since I don’t have access to the XBox 360 SDK.

If you notice any slow downs or other problems because of CLIArgsMadeEasy 2010, let me know.

If you like this add-in and want to support it, donate by clicking in the button:

Download

You can download CLIArgsMadeEasy2010 v1.3 here. (for Visual Studio 2010)

ATTENTION: There is a known bug in CLIArgsMadeEasy2012. If you want the add-in to work properly, please make sure that it is visible in the Visual Studio’s toolbar BEFORE you open a solution, otherwise the add-in won’t behave like it should. This bug doesn’t impact your IDE experience. I’m currently working on a fix but it will take me some time to get it 100%. In the meanwhile you can use the version below.
You can download CLIArgsMadeEasy2012 v1.0 RC2 here. (for Visual Studio 2012)

Many thanks to Diogo Teixeira (aka fozi) for the add-in idea and testing of the program. And I also have to thank Matt Phillips for showing interest in the add-in which inspired me to make this second release.
Thanks to everyone who’s been reporting bugs and helping me building a stable version of CLIArgsMadeEasy.

CLI Args Made Easy

Find the new CLIArgsMadeEasy version here.

Summary

Visual Studio Add-in that puts the project’s command line arguments more accessible.

Description:

Command Line Arguments Made Easy (CLIArgsMadeEasy) is a Visual Studio Add-in that eases the access and change of the startup project’s command line arguments. Instead of having to go to project properties or instead of using the command window to run your program with different arguments, CLIArgsMadeEasy adds a field in the toolbar for you to edit and saves everything you enter. A button is also added that opens a console window in the project’s working directory or home directory (if there’s no working directory set for this project).

Features:

  • Rapidly change startup project’s command line arguments in toolbar.
  • Current session command arguments history.
  • Open console window in working directory or project’s directory (if there’s no working directory set).

Screenshot:

cliargscliargs_options

Future:

  • Support keyboard shortcuts.
  • Save command line arguments history per startup project and between VS sessions.
  • Support for multiple startup projects.

Known limitations:

  • The commands that you insert in the combo box will not do anything if you remove the focus from the combo with a mouse click on any other place. For some reason that I do not understand, when you use the mouse to change the focus, the value that is sent to the event handler is the old value that was in the box, not the new one that the user inserted. So, if you want to change the focus using a mouse click, make sure that you press the enter key in the combo box first.
  • Visual Studio’s extensibility API doesn’t provide an easy way to get a reference to a startup project, so we have to parse the solution which takes some time.
  • Since Visual Studio’s extensibility API doesn’t provide a way to catch any “startup project has change” event, there’s a timer that from time to time checks if there was any change.

I’d really appreciate if someone could give me some tips on how to solve any of these problems.

If you notice any slow downs because of CLIArgsMadeEasy, let me know.

If you like this add-in and want to support it, donate by clicking in the button:

CLIArgsMadeEasy is a free add-in, use it at your own risk. The authors can not be held responsible if anything wrong happens when using this add-in.

Download

You can download CLIArgsMadeEasy 1.0 Beta here.

Many thanks to Diogo Teixeira (aka fozi) for the add-in idea and testing of the program.

Ogre Exporter for Maya 2009 32-bit

A colleague at work needed to export some stuff to Ogre engine from Maya 2009 but there were no exporters available. I compiled the tools and all went well. Here’s the plugin for anyone that needs it.

I realized that I had just compiled the x86 version (32 bits) and not the 64 bits that he needed. Next, I tried to compile the 64 bits version but it proved to be a bit difficult and I couldn’t finish the compilation due to time issues. Ogre seems to compile fine for 64 bits but the problems are the dependencies. I got stuck in the FreeImage library that itself doesn’t appear to have problems with 64 bits. But since FreeImage uses other libraries, one of these libraries was not compiling for 64 bits (OpenJPG I think). So if anyone succeeds on this task let me know.

Instructions

  1. Download Microsoft Visual C++ 2008 SP1 Redistributable Package for x86 from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displaylang=en
  2. Install it.
  3. Download Ogre Exporter for Maya 2009 here.
  4. Unzip the file you just downloaded.
  5. Put ogreExporter.mll in the (Maya2009InstallDirectory)\bin\plug-ins. This is usually under: C:\Program Files\Autodesk\Maya2009\bin\plug-ins.
  6. Put OgreMain.dll in the (Maya2009InstallDirectory)\bin. This is usually under: C:\Program Files\Autodesk\Maya2009\bin.
  7. Put ogreExporter.mel in the (Maya2009UserConfigDirectory)\2009\scripts. This is usually under: C:\Documents and Settings\YourUsername\My Documents\maya\2009\scripts.
  8. Start Maya 2009.
  9. Type ogreExporter in the MEL script prompt and a new window should appear with the exporter.

If you have any problems installing it, contact me.

Regular Expressions (part 2)

The first regexp was thought after someone in the IRC asked for some help. They asked if anyone could remove the comments from a c++ source code file. I tried to help:

(/\*([^*]|[\n]|(\*+([^*/]|[\n])))*\*+/)|(//.*)

Note: this is not the exact expression that I came up at the time but this one is richer and better than the other one I answered at the time.

Let’s analyze it:

  1. /\* – to match with the beginning of any comment /*.
  2. [^*]|[\n] – to match any characters except the * or match with the new line character.
  3. \*+ – matches any number of * in the middle of comments.
  4. [^*/]|[\n] – to match with any character except these two * and / or match a new line.
  5. \*+/ – matches any number of * and the / character.
  6. //.* – matches // followed by any characters.

After matching with the first /* the expression becomes a bit harder to understand. What happens next is that we match anything (including new lines) except the * or we match one or more * followed by anything except the end of comment */. After we match with one ore more * followed by a /.
The second part matches only 1 line comments in C++.

Have you ever received an email full of HTML garbage? It happened to me more than once and it’s extremely annoying having to filter the text in the middle of the HTML. I remembered to create a regular expression that would help me remove this kind of garbage. If you didn’t understand what I meant by garbage, here is an example of these emails:

<html><div style='background-color:'><DIV>
<DIV>
<P class=MsoNormal><FONT color=navy face=Impact size=5><SPAN style="BACKGROUND: #f7f7f7; COLOR: navy;
FONT-FAMILY: Impact; FONT-SIZE: 18pt">This is extremely&nbsp</SPAN></FONT><FONT color=#9966ff
face=Impact size=5 FAMILY="SANSSERIF"> <SPAN style="BACKGROUND: #f7f7f7; COLOR: #9966ff; FONT-FAMILY: Impact;
FONT-SIZE: 18pt">annoying&nbsp;</SPAN></FONT> <FONT color=navy face=Tahoma FAMILY="SANSSERIF">
<SPAN style="BACKGROUND: #f7f7f7; COLOR: navy; FONT-FAMILY: Tahoma">&nbsp;</SPAN></FONT>

In this case I used this regexp:

(\<[^\<]*\>)|&nbsp;

It’s quite pretty to grasp this one, we just grab everything that is between two < > but we have to put a safe guard to exclude a possible < since regular expressions are pretty greedy and like to match whatever they can.
The &nbsp; match the HTML code for space characters serve. We could filter other similar characters but this one seems to do the trick in most situations.

VS File Finder 2008

Summary

Visual Studio Add-in that eases the access to files in large projects.

Description

Visual Studio File Finder 2008 (VSFF2008) is an add-in based on VSFileFinder 2005 developed by Jonathan Payne.

This add-in allow you to find files easily in large projects. The files are listed in a new window where you can type a few letters to narrow the list and open the file(s) you’re interested.

It decreases considerably the file access time comparing to Solution Explorer where you may have to scroll and possibly open some “folders” to find the files.

There are some options to configure this add-in: exclude or highlight different files, tooltips’ configuration, project filter and regular expressions.

Many of these improvement ideas came from Diogo. Some of these were already integrated with the official 1.3 version. This is an updated version with support for Visual Studio 2008.

Changes from original version

  • Added wildcards and regular expression support to search. (Wildcards are on by default.)
  • Added a project filter.
  • It is possible to turn on/off, add a timeout or show tooltips with the complete name of the file.
  • Fixed possible bug in tooltips that don’t go away.

Screen shot

vsffvsff_options

VSFileFinder 2008 is a free add-in, use it at your own risk. The authors can not be held responsible if anything wrong happens when using this add-in.

Download

You can download VSFileFinder2008 1.4 Unofficial here.

To download the original version click here.

Again, this add-in was not made by me. I just added some features to the original.

I want to thank Jonathan Payne for the creation of this great add-in and Diogo Teixeira for the suggestions and testing he made.

Visual Studio 2005/2008 Free Utilities

Here are some free add-ins/tools/utilities that you can use in Visual Studio 2005 (or 2008):

AnkhSVN

http://ankhsvn.open.collab.net/
Do you use subversion version control system? TortoiseSVN? This add-in is great and integrates very well with all VS versions since 2002.

CLIArgs Made Easy

http://www.ricardosabino.com/?pag=vs_addin1
CLI Args Made Easy (Command Line Arguments Made Easy) is an add-in that allow you to change the command line arguments of the startup project very easily by adding a combobox in the toolbar. It also saves all the arguments you insert for future use.

Microsoft Visual Studio 2005 IDE Enhancements

http://www.microsoft.com/downloads/details.aspx?FamilyID=CD7C6E48-E41B-48E3-881E-A0E6E97F9534&displaylang=en
Set of Visual Studio extensions that improve productivity: Source code outliner, Visual C++ code snippets, indexed find, super diff utility, event toaster utility.

MPCL

http://www.todobits.es/mpcl.html
This plug-in allow us to compile the source code files of a Visual Studio 2005 project in parallel. This is extremely useful for processors with more than one core to reduce the compile time.

Power Toys for Visual Studio 2005

http://msdn2.microsoft.com/en-us/vstudio/aa718340.aspx
Pack with various tools for VS 2005.

Project Line Counter

http://www.wndtabs.com/download/Download/LineCounter/
Reports statistics about the files in projects. It’s automatic, has a filter and you can check its source code.

Refactor! For Visual Studio 2005/2008

http://msdn2.microsoft.com/en-us/visualc/bb737896.aspx
Free add-in that refactors (simplifies and re-structures) source code to make it easier to read and less costly to maintain.It has more than 15 different features.

RockScroll

http://www.hanselman.com/blog/IntroducingRockScroll.aspx
This add-in extends the Visual Studio’s scroll bar showing the code with syntax highlight. It is extremely useful to go to where you want within long source code files.

SlickEdit Gadgets

http://www.slickedit.com/content/view/441
Free useful gadgets for VS 2005: Editor gadgets – line ruler, indentation guide, auto-copy selection, editor graphic; command spy, file explorer, data object analyzer and SLOC report.

VSFileFinder 2005/2008

http://www.zero-one-zero.com/vs/
VSFileFinder helps you find files quickly in your projects by typing a few letters from any part of the file name which is much faster than using the solution explorer in large projects.

There is also a version with some improvements (wildcards, regular expressions, personalized tooltips, project filter) and compatible with Visual Studio 2008 available here: VSFileFinder2008.

Visual Studio Add-Ins Every Developer Should Download Now

http://msdn.microsoft.com/msdnmag/issues/05/12/VisualStudioAddins/
MSDN page with a collection of free add-ins mostly for .net languages but not only.

Regular Expressions (part 1)

A while ago I was refactoring the #include’s of c++ project and I needed to know which project files were including STL files (in our case it meant that the included files wouldn’t have the .h). So, I decided to make a regular expression to find these files:

\#include:b*\<.+[^\.h]\>

If you insert this simple expression in the search box of the Visual Studio you can get a list of all #include’s that don’t have the .h in the name of the file. Now I’ll break the regular expression and try to explain it step by step:

  1. \#include – to match with any #include expression.
  2. :b* – to match with any number of spaces or tabs.
  3. \< – to match with the < character.
  4. .+ – to match one or more characters.
  5. [^\.h] – exclude the .h characters.
  6. \> – match with the > character.

Meaning of the characters in the expression:

  • \ – escape a character, the character after this symbol is treated as a normal character instead of a special character used in regular expressions.
  • :b – space or tab.
  • * – 0 or more times.
  • + – 1 or more times.
  • . – any character except the end of line.
  • [] – any set of characters inside the [].

Note: this regular expression might not be compatible with other programs because it uses specific expressions of the VS, such as the :b that matches a space or tab.

Another example, remove the initial characters (garbage) from actual lines code:

1.          #include <iostream>
2.             using namespace std;
3.         int main()
4.           {
5.           cout << "Hello World!";
6.        return 0;
7.         }

I’m sure you already found something like this and when you put it in the editor it’s really a pain in the ass to remove all that garbage line by line. Here’s another expression that will help in this task:

^[^a-zA-Z_$/{}\#"'\+\-]+

Again, let’s go step by step:

  1. ^ – this means that we’ll start to match only at the beginning of a line.
  2. [^…]+ – matches any character that is not in the set of characters that follows the ^.
  3. a-zA-Z_$/{}\#”‘\+\- – exclude the characters from a to z (same for uppercase letters) and the following characters: _, $, /, {, }, #, , , + and .

This means that this expression catches anything that starts with any character except the characters that are excluded. In the VS, replace this expression by an empty string to remove the garbage.
Note: It’s quite possible that the regular expressions presented here will fail (specially the second one), because it’s really complicated to test all the possibilities but in the general case, these should work.

I hope these two examples will make you see the power of regular expressions or even be useful to you ;) If you have any comments about this article or do you have any problems with a regular expression? Just let me know.