TFS 2010 - Annotate Class Files - visual-studio-2012

Within TFS 2010 there is the functionality to Annotate a class / page so that it shows where different pieces of code have been changed, along with who changed them, the date and the change set.
So my question, which is hopefully a relatively straight forward one, is: Can this be filtered to a date range, work item ID or user? Or would a separate report be needed to provide this functionality? I am mainly interested in the ability to do this within Visual Studio 2012 and not so much a report, as it would help with our release proceedure in development.

Annotate shows who wrote (or last changed) each line of code. So restricting it to a date range would fundamentally change the way it worked. VS/TFS don't provide any ability to customize how Annotate works.
You could always create your own Visual Studio add-in that provided this functionality.

Related

How to enable grouping in the File Structure Window in VS2017

I recently installed Resharper 2017.1.3 on Visual Studio 2010 and 2017.
On 2010, the File Structure window has a nice grouping based on categories (private method, public methods, override, etc - see image below). However, in 2017 there is no grouping at all.
I'd like to know if anyone can show me how to enable that in 2017. I tried researching it but couldn't find any solution.
thanks,
ReSharper's structure window doesn't have any grouping functionality as such - it always shows files in the order in which everything is defined. However, it does show regions as groups, as in your first screenshot. Those EqualsCore methods are both defined inside a region, and so get grouped by that.
(You'll also notice the little 'x' in the top right of the region grouping box. Click that and ReSharper will remove the region.)

VS2012 - TFS is changing objects from lower case to Upper case (VB6)

I have just started having this issue today with VS2012 and TFS.
We have our VB6 classes stored in Team Foundation Server.
I checked out a (VB6 *.cls) class for edit (in VS2012 TFS), then edited it in the Visual Basic 6 IDE, changing no more than 20 lines out of about 8900 lines in the class, before saving the class.
Unfortunately, when I try to compare my changes with the Latest version in TFS, I am getting hundreds of changes because either Visual Studio or TFS is changing all the Adodb. to 'ADODB.' as in the below picture
This makes it very difficult for my colleagues to review my code changes, as there should be no more than about 20....
EDIT: It looks like it is VB6 doing all these changes...
What do I need to change to fix this?
This is not a TFS issue. VB6 does this when it thinks the declaration of an object or variable has changed it's case-spelling.
But you can address this in TFS. Configure TFS to use an external compare tool, such as Beyond Compare or WinMerge (there are lots of others) that support case insensitive comparisons.

%(AdditionalIncludeDirectories) meaning

Think this will be rather simple but somehow I could not find a reference saying about this.
In the MSVC Include directories, there is an Additional Include Directories setting. The setting reads like this
..\Project1; %(AdditionalIncludeDirectories)
Understand the first part is the path for the program to search for additional program header includes. What about " %(AdditionalIncludeDirectories) " ? what does it mean?
It does not seem to be a macro which I understand is headed by "$" eg $MACRO
Thanks
Answer
In the documentation for Working with Project Properties there is a section on "item macros":
Item macros
Has the syntax %(name). For a file, an item macro applies only to that fileā€”for example, you can use %(AdditionalIncludeDirectories) to specify include directories that apply only to a particular file. This kind of item macro corresponds to an ItemGroup metadata in MSBuild. When it's used in the context of a project configuration, an item macro applies to all files of a certain type. For example, the C/C++ Preprocessor Definitions configuration property can take a %(PreprocessorDefinitions) item macro that applies to all .cpp files in the project. This kind of item macro corresponds to an ItemDefinitionGroup metadata in MSBuild. For more information, see Item Definitions.
Discussion
I had exactly the same problem in a project I am taking over from a former developer : his Additional Include Directories are C:\Users\t-tshmit\Downloads\DirectXTK;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
And oddly the %(AdditionalIncludeDirectories) element is not included in the edit box
Looking around the web I could not find much on this, but it is clearly a pattern in use, for example the screenshot used in http://www.steptools.com/support/stdev_docs/help/settings_vc10.html may contain the %(AdditionalIncludeDirectories) element.
The documentation for both the Additional Include Directories compiler options and the AdditionalIncludeDirectories VCCL Compiler Tool property contain no mention of this %(NAME) pattern.
https://learn.microsoft.com/en-us/cpp/build/reference/common-macros-for-build-commands-and-properties?view=vs-2019
They are called "item metadata macros."
The build system for C++ was significantly changed between Visual
Studio 2008 and Visual Studio 2010. Many macros used in earlier
project types have been changed to new ones. These macros are no
longer used or have been replaced by one or more equivalent properties
or item metadata macro (%(name)) values. Macros that are marked
"migrated" can be updated by the project migration tool. If the
project that contains the macro is migrated from Visual Studio 2008 or
earlier to Visual Studio 2010, Visual Studio converts the macro to the
equivalent current macro. Later versions of Visual Studio can't
convert projects from Visual Studio 2008 and earlier to the new
project type. You must convert these projects in two steps; first
convert them to Visual Studio 2010, and then convert the result to
your newer version of Visual Studio. For more information, see
Overview of potential upgrade issues.

Commands functions available when a reference is available in the VB for applications reference list in Excel

I am a hacker with very little training. I have discovered that there are these things that might be called Microsoft Automation Objects that software developers make available to VB through for example the list of references found when you use VB interface in Excel. Specifically if I start Excel select the Developer tab, select Visual Basic and then from Tools Select References I get a select box that has a large number of dlls listed.
I found a list of functions that were 'exposed' for one of the listed references. It was really neat and I could make excel interact with the program itself.
So my question - is there a standard way to determine what 'functions' are exposed by a particular reference listing?
If I am confusing, sorry, let me make an analogy
I use Python and I can find out the things that are available to act on a particular object by typing
dir(object)
Is there something analogous for VB?
You can select libraries in the Object Browser (code window) and you can set a Watch and step through code. Quite a lot of stuff is listed with Intellisense. BTW in Excel etc, it is VBA.

Is there a way in Visual Studio to specify what a template class (new class) is going to look like?

I'm a long time Eclipse user trying to learn to Visual Studio. I know that Eclipse had Code Templates that would allow you to build classes with certain comments and formatting already added for a class.
For example:
Auto placing the copyright for the code at the top of the file
Who created the file
Predefined Comments,
etc...
Does Visual Studio 2005 have any functionality like this?
It depends. Visual Studio has a built-in code snippets manager that lets you do things like this to at least a degree (i.e., if you insert a code snippet, it'll be formatted as the snippet specifies, but if you write the same code manually, it won't). Also note that there are limitations on the languages with which you can use code snippets.
Outside of that, most of the major add-ins for VS (e.g., Visual Assist-X) provide their own ability to store and insert bits of code, formatted as you specify. Most of these provide at least some features missing from the built-in snippets manager such as working with other languages or being easier to access (along with quite a few other things -- IMO, VS borders on completely unusable without VA-X).
I would recommend looking at item and project templates in Visual Studio, which sound like what you're looking for. But, in your particular case (C++ development), it doesn't look like this is available to you.
The following MSDN article refers to VS templates, and mentions that for Visual C++ projects, that the template architecture isn't supported. Instead, there's information on creating custom wizards for your project and classes, which may give you the flexibility that you need. Sounds like it'll do what you want it to do, but it's much more work than it would be if you could use an item template for including basic comment structure for a default class file.
http://msdn.microsoft.com/en-us/library/6db0hwky%28VS.80%29.aspx

Resources