"Show Source of Selected Element Only" in Visual Studio 2003 - visual-studio

There is a feature in Eclipse ("Show Source of Selected Element Only") which allows to view the code of the selected method only. All other part of the code is invisible.
I remember that a similar feature was available in Visual Studio 6.0. I would like to know if this feature is available in Visual Studio 2003 and up? If yes, please point out where to find this in the IDE.

This is not available in any one of the later releases. It was called "procedure view" in VS 6. Use outlining feature instead.

Related

Add ATL Simple Object in Visual Studio 2017

I am working with an old ATL/COM project in Visual Studio 2017.
In previous versions of Visual Studio you could select "Add Class" and then select the option "Add simple ATL object" to add a COM class to the project. This option appears to be completely missing in Visual Studio 2017.
Has the option been moved?
Have I missed an installation option?
Does Visual Studio fail to recognize my project as an ATL project? (It was created with a much older version.)
Or is this the end of the road for ATL?
I'm not sure whether this an answer, but it is too much for a comment and more than just an edit to the question.
I have tested on two systems, with
Visual Studio Community 2017, Version 15.1
Visual Studio Professional 2017, Version 15.3.2
and I believe that the functionality has changed between these two versions. I think it is unlikely to be a difference between the Community and Professional versions.
In both cases I created a new ATL project and tried three ways to add a class:
Add class... from the context menu in the Class View
Add class... from the context menu in the Solution Explorer
Add New Item... from the context menu in the Solution Explorer
With version 15.1, Add Class opens the following dialog, from which I can add an ATL Simple Object.
With version 15.3.2, Add Class opens the following dialog, without any option for an ATL Simple Object.
However, with version 15.3.2, Add New Item opens the following dialog, with a new option to create an ATL Simple Object, which was previously not available in this dialog.
So, it seems that the functionality has been moved. Curiously, it is no longer available in the Class View (which in my opinion is a mistake).
This problem is caused by changes in the project template and code wizard in version 15.3 of Visual Studio 2017.
The operation procedure has changed between version 15.2 or earlier and version 15.3 or later.
The blog article that explained this change is as follows.
Changes to Project Templates and Code Wizards in 15.3
Although it is described as an item in the release notes, there are few people who are watching, and details on how the actual is going on is unknown.
Visual Studio 2017 version 15.3 Release Notes
C++ Language Services
Project and Code Wizard
•We have rewritten several project and code wizards in the signature dialogue style.
•Add Class launches the Add Class wizard directly. All of the other items that were previously here are available under "Add > New Item".
•Win32 projects are under the Windows Desktop category in the New Project dialog.
•The Windows Console and Desktop Application templates now create the projects without displaying a wizard. There's a new Windows Desktop Wizard under the same category that displays the same options as before.
My experience with Visual Studio 2015 version 15.9.2 is that I had to uncheck Security Development Lifecycle (SDL) checks when I added an ATL Project, otherwise when I add the Simple ATL Object I get a messagebox with the error "did not find a .idl file in project name of my project".

Filtering the Visual Studio toolbox

Does anyone know if it is possible at all to filter the Toolbox's items in Visual Studio using an add-in?
Visual Studio 2010 introduced the ability to search but I want to filter, for example: type in button and it must show all items containing "button", same as on this on this Delphi XE screenshot:
This is a very good answer for this question. I copied from the VS blog:
In VS 2010 Beta2, we’ve added the ability to search for controls in the toolbox by name. To use it, put focus in the toolbox (by clicking in it, for example) and start typing the name of the control you want to find. As you type, the selection will move to the next item that matches what you've typed so far.
http://blogs.msdn.com/b/visualstudio/archive/2009/10/26/toolbox-search.aspx
This is something not possible as microsoft does not reveal the secret of adding toolbox controls details completely. They make change the process for each platform and for each versions of visual studio. if we have a clear details of how they add, we can also do the similar kind of small application with search capability and add it as add-in.
Luckily Visual Studio 2012 now has that feature!

Visual Studio - I want "Go To Definition" to open Object Browser, not "metadata"

In Visual Studio version 2002 and 2003 "Go To Definition" would find the selected type or member in the Object Browser. In 2005 onwards it opens a source window "generated from metadata" instead. How do I configure these newer versions to go to Object Browser? (In other words, I have the opposite problem to this one.)
Installing ReSharper makes this change, so I know it must be possible, but how do I do it without ReSharper?
As workaround you can create the following macro:
Sub GoToDefinitionUsingObjectBrowser()
DTE.ExecuteCommand("Edit.SelectCurrentWord")
DTE.ExecuteCommand("View.ObjectBrowser")
DTE.ExecuteCommand("View.ObjectBrowserSearch", DTE.ActiveDocument.Selection.Text)
End Sub
Then go to Tools/Options/Keyboard and assign hot key for this macro.
Tested in Visual Studio 2010.
I believe what re-sharper is doing is doing some hooks on that click event with the Visual Studio SDK I do not think there is any simple menu or location that can change that setting.
Instructions (pulled from CODE Magazine) edited down a bit to the part that pertainst to making the right click menus.
Creating a VSPackage
...The VS SDK installs a few more project
templates in Visual Studio, one of
them being the Visual Studio
Integration Package (Figure 1),
located under Other Project Types >
Extensibility on the New Project
dialog box.
After this standard dialog box, the
Visual Studio Integration Package
Wizard guides you through creating the
new package project:
Select a programming language. The wizard currently supports Visual
C++ and Visual C#. You can create or
pick a key file to sign the new
package.
Supply basic VSPackage information. The wizard prompts you
for details such as the company name,
VSPackage name, version, icon,
detailed information, and minimum
Visual Studio edition (such as
Professional or Enterprise) that the
package is designed to at this step.
This information goes into the Visual
Studio splash screen and About dialog
box and is also used to request a PLK
for the package (covered later).
Select VSPackage options. A package may add three types of
functionality: Menu Command, Tool
Window, and Custom Editor.
A menu command is a command added either to the menu
at the top of Visual Studio or
to a context menu (right-click).
When the wizard finishes its job, the
VS SDK adds core elements to the
solution to support the new package.
For instance, if you selected Tool
Window as part of the functionality
for the package, the project contains
a user control where you should place
the visual controls for the window.
The project also contains files for
.NET code to handle the functionality
that you will add to the package.
A CtcComponents folder contains
pseudo-C++ files (ctc files) where you
define things like menu, groups,
buttons, etc. Fortunately, Microsoft
is phasing out CTC files and replacing
them with a friendlier, XML-based VSCT
file format (which will ship in the
SDK for Visual Studio 2008).
The wizard creates a few other files
with .NET code required for the
plumbing of the package within Visual
Studio. Some of these files contain
classes that map the C++ constants to
.NET constants and other files contain
configuration information for the
package when it’s installed.
I know it has been a long time, but it appears, at least in newer versions of Visual Studio for the VB (Basic) language, to be an setting in the options.
Text Editor > Basic > Advanced
Under "Go to Definition".
I don't know why they don't have that for other languages...
Place the mouse cursor on the object you want to access on the object browser. Then, use the keyboard shortcut ctrl + alt + j, which will take you directly to the Object Browser window.

Launch Reflector from Visual Studio 2008 References Section in Solution Explorer

How do you configure Visual Studio 2008 to launch the Redgate .Net Reflector from a right click on an assembly in the references section in the solution explorer? I have it set up at the office to do this, so I know it's possible.
I do have ReSharper installed but I don't think this is ReSharper functionality.
UPDATE
This is the functionality I'm looking for...
alt text http://www.imagechicken.com/uploads/1266849634078638500.jpg
Do you have Reflector 6 or 5?
If you have 5, then you need TestDriven.Net.
If you have 6 you don't need TestDriven but you will need to right click on the refence -> View in Object Browser, then right click on the assembly and choose Open in .Net Reflector
v 6 also added the integration in the code editor of VS, so you can right click on an object's name and choose Open in .Net Reflector ... which may actually be used more than looking at the whole assembly (via the object browser).

replacing vs object browser with reflector?

Has anyone tried to build or seen a plugin for visual studio that replaces the object browser of with Reflector? It would be really cool if I do "Go to Definition" I would end up in Reflector at the correct place instead of in the VS object browser.
The TestDriven.net Visual Studio addin (also from here) adds a menu item to go to Reflector from within Visual Studio. I don't think it replaces "Go to Definition" though, so you would have to click the correct (ie. Reflector) menu item.
A Reflector Pro (paid for version of Reflector) is coming soon, which gets installed into Visual Studio, so it may have the ability to decompile source code using Reflector instead of using the object browser. If not, ask for it as a new feature on their forum :)
EDIT: as if almost on cue, the beta of Reflector Pro was announced today and it does have an "Open in Reflector" command.

Resources