<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alteridem Consulting &#187; Visual Studio</title>
	<atom:link href="http://www.alteridem.net/category/tools/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alteridem.net</link>
	<description>Software by Design</description>
	<lastBuildDate>Fri, 02 Sep 2011 14:21:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Visual Studio 2010 Command Prompt Here</title>
		<link>http://www.alteridem.net/2010/09/02/visual-studio-2010-command-prompt-here/</link>
		<comments>http://www.alteridem.net/2010/09/02/visual-studio-2010-command-prompt-here/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 17:52:37 +0000</pubDate>
		<dc:creator>Robert Prouse</dc:creator>
				<category><![CDATA[Tips'n'Tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alteridem.net/2010/09/02/visual-studio-2010-command-prompt-here/</guid>
		<description><![CDATA[Real developers live on the command line. Way back in 1996, Microsoft released the Command Prompt Here Power Toy to ease their pain. Industrious developers who preferred the Visual Studio command prompt took it and adopted it to run a Visual Studio command prompt with all of the paths to Visual Studio and .NET tools [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 6px 6px; display: inline; border-top: 0px; border-right: 0px" title="CmdPrompt" border="0" alt="CmdPrompt" align="right" src="http://www.alteridem.net/wp-content/uploads/2010/09/CmdPrompt.png" width="310" height="296" /> Real developers live on the command line. Way back in 1996, Microsoft released the <a href="http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx">Command Prompt Here Power Toy</a> to ease their pain. Industrious developers who preferred the Visual Studio command prompt took it and adopted it to run a Visual Studio command prompt with all of the paths to Visual Studio and .NET tools in the path.</p>
<p>In the fine, time honored tradition, I have continued to update with each new Visual Studio release and have finally done so for Visual Studio 2010.</p>
<p>To install, download, unzip and right click and install the INF file, it will add a “VS 2010 Cmd Prompt Here” menu item when you right click on a folder in Explorer. Clicking on the menu item will launch a DOS prompt in that directory with all of the Visual Studio and .NET paths set correctly.</p>
<ul>
<li><a href="http://www.alteridem.net/wp-content/uploads/2010/09/vsnet2010cmdhere_x86.zip">Visual Studio 2010 Command Prompt Here (x86)</a></li>
<li><a href="http://www.alteridem.net/wp-content/uploads/2010/09/vsnet2010cmdhere_x64.zip">Visual Studio 2010 Command Prompt Here (x64)</a></li>
</ul>
<p>This assumes that you have installed Visual Studio to the default directory on the C drive. If that is not the case, edit the INF file and change line 38 to the correct path for your installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alteridem.net/2010/09/02/visual-studio-2010-command-prompt-here/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visual Studio Macro to switch between CPP and H files</title>
		<link>http://www.alteridem.net/2008/02/26/visual-studio-macro-to-switch-between-cpp-and-h-files/</link>
		<comments>http://www.alteridem.net/2008/02/26/visual-studio-macro-to-switch-between-cpp-and-h-files/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 15:30:02 +0000</pubDate>
		<dc:creator>Robert Prouse</dc:creator>
				<category><![CDATA[Tips'n'Tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alteridem.net/2008/02/26/visual-studio-macro-to-switch-between-cpp-and-h-files/</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of managed C++ programming lately and I had forgotten what a pain it is switching back and forth between the header file and source file.&#160; Back in the days of Visual Studio 6 I had a macro that switched between the CPP and H file, so I went googling, but [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of managed C++ programming lately and I had forgotten what a pain it is switching back and forth between the header file and source file.&nbsp; Back in the days of Visual Studio 6 I had a macro that switched between the CPP and H file, so I went googling, but the macro I <a href="http://www.codeguru.com/cpp/v-s/devstudio_macros/article.php/c3093/">found</a> didn&#8217;t work very well in VS2008.&nbsp; Like any good coder, I decided to write it myself instead.</p>
<p>If you haven&#8217;t written a macro before, here are the steps.</p>
<ol>
<li>In Visual Studio, go to <strong>Tools | Macros | Macros IDE</strong>. A new window should open and in the Project Explorer, the MyMacros project should be open.
<li>Right click on the <em>MyMacros</em> project and select <strong>Add | Add Module</strong>. Name it <em>CppUtilities</em>.&nbsp; The <em>CppUtilities</em> should open in the editor window.
<li>Add the code from below into the module and save the project.</li>
</ol>
<pre name="code" class="vb:nogutter">
‘=====================================================================
‘ If the currently open document is a CPP or an H file, attempts to
‘ switch between the CPP and the H file.
‘=====================================================================
Public Sub SwitchBetweenSourceAndHeader()
  Dim currentDocument As String
  Dim targetDocument As String

  currentDocument = ActiveDocument.FullName

  If currentDocument.EndsWith(“.cpp”, StringComparison.InvariantCultureIgnoreCase) Then
    targetDocument = Left(currentDocument, Len(currentDocument) - 3) + “h”
    OpenDocument(targetDocument)
  ElseIf currentDocument.EndsWith(“.h”, StringComparison.InvariantCultureIgnoreCase) Then
    targetDocument = Left(currentDocument, Len(currentDocument) - 1) + “cpp”
    OpenDocument(targetDocument)
  End If

End Sub

‘=====================================================================
‘ Given a document name, attempts to activate it if it is already open,
‘ otherwise attempts to open it.
‘=====================================================================
Private Sub OpenDocument(ByRef documentName As String)
  Dim document As EnvDTE.Document
  Dim activatedTarget As Boolean
  activatedTarget = False

  For Each document In Application.Documents
    If document.FullName = documentName And document.Windows.Count &gt; 0 Then
      document.Activate()
      activatedTarget = True
      Exit For
    End If
  Next
  If Not activatedTarget Then
    Application.Documents.Open(documentName, “Text”)
  End If
End Sub
</pre>
<p>If you switch back to Visual Studio and open the Macro Explorer, you should see the new module <em>CppUtilities</em> and the new macro <em>SwitchBetweenSourceAndHeader</em> in the tree.&nbsp; You could run the macro from here, but it is much easier to bind it to a keystroke.</p>
<ol>
<li>Click on <strong>Tools | Options</strong> then go to the <strong>Environment | Keyboard</strong> tab.</li>
<li>In the <strong>Show commands containing: </strong>box, type <em>CppUtilities.</em> This should filter the list down to one entry, <em>Macros.MyMacros.CppUtilitities.SwitchBetweenSourceAndHeader</em>.</li>
<li>Click on the <strong>Press shortcut keys:</strong> text box and then press the keystroke you would like to use to run the macro. If the keystroke is already used, it will show you below in the <strong>Shortcut currently used by:</strong> dropdown.&nbsp; When you find one that is unused, click the <strong>Assign</strong> button to use it.&nbsp; I use <strong>Ctrl+Shift+Alt+Bkspce</strong>.</li>
<li>Click <strong>OK</strong> then open a CPP or H file and give it a try.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.alteridem.net/2008/02/26/visual-studio-macro-to-switch-between-cpp-and-h-files/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Quickly Find/Open a File in Visual Studio</title>
		<link>http://www.alteridem.net/2007/09/11/quickly-findopen-a-file-in-visual-studio/</link>
		<comments>http://www.alteridem.net/2007/09/11/quickly-findopen-a-file-in-visual-studio/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 20:02:57 +0000</pubDate>
		<dc:creator>Robert Prouse</dc:creator>
				<category><![CDATA[Tips'n'Tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alteridem.net/2007/09/11/quickly-findopen-a-file-in-visual-studio/</guid>
		<description><![CDATA[Here is a cool Visual Studio feature that almost nobody knows about. If you want to open up a file in your solution, but can&#8217;t be bothered to dig down through your projects and folders to find it, try this, Click in the Find box in the toolbar, Type &#62;of followed by a space, then [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a cool Visual Studio feature that almost nobody knows about. If you want to open up a file in your solution, but can&#8217;t be bothered to dig down through your projects and folders to find it, try this,</p>
<ol>
<li>Click in the Find box in the toolbar,
<li>Type &gt;of followed by a space, then begin the name of the file you are looking for.
<li>An auto-complete drop down will appear as you type filtering all the files in all your projects in your solution. Continue typing until the list is short enough to fine the one you want. Select it and hit enter.
<li>The file will open in the editor.</li>
</ol>
<div align="center"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="218" alt="openfile" src="http://www.alteridem.net/wp-content/uploads/2007/09/openfile.png" width="265" border="0"></div>
<p><b>Update:</b> After this post made the front page of <a href="http://www.dotnetkicks.com/">DotNetKicks</a>, Aaron Lerch wrote a <a href="http://www.aaronlerch.com/blog/2007/09/11/the-talented-mr-editgotofindcombo/">great post</a> on his blog with more things that you can do with the find combo. One thing that is very useful is that with the <strong>></strong>, you can issue any command, the alias <strong>>of</strong> mentioned here is just one of many. For a list of the commands, check out <a href="http://msdn2.microsoft.com/en-us/library/c3a0kd3x(VS.80).aspx">this MSDN page</a>.</p>
<p>Another useful tip is that <strong>Ctrl+D</strong> or <strong>Ctrl+/</strong> will automatically jump to the find box, so your hands don&#8217;t even need to leave your keyboard.</p>
<p><b>Update:</b> This trick was also mentioned on Just Sayin More Words as a part of his <a href="http://john-sheehan.com/blog/index.php/stupid-visual-studio-trick-part-3/">Stupid Visual Studio Trick</a> series. Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alteridem.net/2007/09/11/quickly-findopen-a-file-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Debugging C++ Method Parameters</title>
		<link>http://www.alteridem.net/2007/09/11/debugging-c-method-parameters/</link>
		<comments>http://www.alteridem.net/2007/09/11/debugging-c-method-parameters/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 19:20:04 +0000</pubDate>
		<dc:creator>Robert Prouse</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[C++/CLR]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alteridem.net/2007/09/11/debugging-c-method-parameters/</guid>
		<description><![CDATA[New Rule: Make sure your parameter names are consistent between your declarations and definitions in C++. Here is why&#8230; I was trying to debug some C++/CLR code today when I ran into an interesting behavior (bug?) in Visual Studio 2005. I had a breakpoint in the first line of my method which I hit fine. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>New Rule: Make sure your parameter names are consistent between your declarations and definitions in C++.</strong></p>
<p>Here is why&#8230;</p>
<p>I was trying to debug some <strong>C++/CLR</strong> code today when I ran into an interesting behavior (bug?) in <strong>Visual Studio 2005</strong>. I had a breakpoint in the first line of my method which I hit fine. I then tried to inspect the value of the two integers that were passed in. The first one showed up fine when I moused over it, but the second one didn&#8217;t appear. Strange, but I&#8217;ve come to expect that debugging in C++.</p>
<p>The next thing I tried was the Watch window (Ctrl+Alt+W,1). I added both of the parameters. The first showed up fine, but the second said <strong>&#8220;error: identifier &#8216;maxRows&#8217; out of scope.&#8221;</strong> How could it be out of scope, I was on the first line in the method?</p>
<p>Next I looked at the Locals window (Ctrl+Alt+V,L). The parameter was showing up fine there! Then I noticed the difference, the name of the parameter in the locals window wasn&#8217;t pluralized. Sure enough, I looked in the header file and it was spelled <strong>maxRow</strong> there.</p>
<p>It turns out that the debug symbols are taken from the header files, so when you step into a method with parameters that are spelled differently, then you must use the values in the header file to inspect the variables.</p>
<p>Here is an example I mocked up where the parameters were x and y in the header files.</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="CppDebugging" src="http://www.alteridem.net/wp-content/uploads/2007/09/cppdebugging.jpg" width="443" border="0"> </p>
<p>I also tried this in unmanaged C++ and got the same result.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alteridem.net/2007/09/11/debugging-c-method-parameters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

