How to change default code in Visual studio - c++

I am going to programming c++ with Visual Studio, but there is something annoying and that's the default code, which is shown automatically in launching the editor. Is there a way to change that or it is rigid ?
Thanks.

Yes there is: you can create a Visual Studio project template and use that as the basis for future projects. The way you do this is to get your project looking how you like it and then save it as a template. Full details here:
https://learn.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates?view=vs-2019

Related

How do i change the colours of visual studio? [New user]

Im currently a C++ student in uni. I started using visual studio code configurated by a friend and then i changed to visual studio 2022 (the community version).
In visual studio code the code looks prrety much like this:
Then in visual studio it looks like this:
Does anyone know how to change the highlighted or at least can give me a hint? thanks!
I tried looking in the settings on visual studio but i got confused since there are many options and i dont know exactly what to change
You are probably looking for the Visual Studio Theme Pack extension, which brings the default VS code themes to VS. Also see this blog post for other converted popular VS code themes, and this blog post which describes a tool to convert any VS code theme.
Regarding the colored (rainbow) braces, there is the "Rainbow Braces" extension (corresponding blog post).
For further configuration, you might also want to have a look at the Visfora extension, which also includes rainbow braces.
Extensions aside, many of the colors can also be manually and individually configured in the Visual Studio's options → Environment → Fonts and Colors.

Why visual studio doesn't come with Resources template by default?

Hello I am trying to create a “.resx” file and when I went to the menu add “new item” it doesn't show me the template for create resources file as it shows in the following image. But if I go to Visual Studio 2015 it actually shows that option available. So why if it is visual studio 2017 it doesn't come with that template by default ? And I want to know what are the steps that I have to take in order to install this template.
Note: If my question is incorrectly please AND YOU ARE GOING TO GIVE ME A DISLIKE make sure to GIVE ME A FEEDBACK Thank you for reading this.
click here to see the picture
After having the same issue (I think). I found that you have to choose ".NET desktop develpment" when you install VS 2017 to get the resource template.
Search for visual studio installer in your menu and then choose modify.
Check ".NET desktop develpment" and click modify. After that you should be able to see the templates in VS 2017.
what about this one?
ResX Manager

Attaching Documentation in Visual Studio (à la Eclipse)

I'm new to Visual Studio (2012) and having come from using Eclipse, I'm finding myself missing the ability to hover my mouse over a method and receive a dialogue detailing the parameters and any accompanying comments.
In this particular example, I'm using the OpenGL SDK with C++ in Visual Studio, and I would like to be able to quickly get at the documentation without having to jump between VS and http://www.opengl.org/sdk/docs/man/.
Is there a way that I can attach the documentation somehow so that I can view it from within Visual Studio itself without needing to manually search?
visual studio does provide the functionality you are looking for as a tooltip (instead of a dialogue) when you hover long enough (2-3 seconds). For this to work correctly and more usefully though, you'd need the functions to be documented properly in the code itself.
Check the following questions for more information on how intellisense tooltip works :
How to get full intellisense tooltip comments working?
Documenting C++/CLI library code for use from c# - best tools and practices?
By default though, intellisense will simply display the comment above the function declaration or deninition (which ever comment is larger, it seems). It takes a while longer when you hover first time over a function, so be patient and retry :)
you can type in the code 3 slash /// and visual studio automaticalli write a xml template for the documentation of the method/class/property.
next you can go in the project properties. Build tab, Output section, XML documentation file, and enter the filename. It will be built on every build of the project.
You could try NDOC or SandCastle if you dont mind using 3rd party tools.

Visual Studio 2010/2012 Add-in Project Questions

I have already created a simple source code analyses tool for C/C++, but I wanted it to be an extension or tool for Visual Studio 2010 and 2012 editions. It is written completely in C++. For this reason I created it using "Create an Add-in using Visual C++/ATL" option. And then under "Choose Add-in Options", I have some problems. I don't know which one or ones to select. I want it to have a name and icon under Tools section, but on the other hand, my code analyzer can be used from command line too. If someone can advice me which option(s) to select there I would be glad.
My second question is this, when I have opened a source file in Visual Studio, and if I go to Tools -> MyAddin, and press it, I want it to do its job and analyze the code, and show the results in the output section below.
And my last question is that, if I have a C/C++ project with few files let's say, and if I right-click one of the files, I want to see my add-in and be able to execute the add-in from there, not to go always to Tools -> MyAddin. And also the same thing to work if I right-click the project, then it should analyze the all files and show the problems in the output section.
Please note that I have already created the source code analyzer tool in C++, and I have it as a DLL. I can also use it in Linux from terminal, and if I want I can also create a GUI for it, which I plan to do later. But I'm not that much experienced with Visual Studio, especially about add-ins, that's why I need your help. As you can see my first question is a kind of advice, but I think my second and third questions require some source code. I know that it is very hard for you to give me some help without seeing my code, but if you would help me somehow I would be glad.
For Visual Studio 2010 and 2012 you should consider using Extensions, not Add-Ins. It is a new technology introduced in Visual Studio 2010. Extensions come in form of a VSIX packages and are automatically installed in all applicable versions of Visual Studio. If you are not targeting Visual Studio version prior to 2010, I strongly recommend using extensions.
From this point of view, I will not answer any of your technical questions about Add-Ins. Here are a couple of links to start using extensions instead:
Anatomy of a VSIX Package
Building and publishing an extension for Visual Studio 2010
VSX FAQ
Walkthrough: Creating an Options Page
I think you will find valuable information on this topic here: Developing extension packages for Visual Studio 2005/2008/2010/2012 using C# with real-life samples

No Auto Complete Visual Studio 2010

Im using MS visual studio 2010 PRoofessional version , and in both languages I'm using (C++ and UnrealScript with Nfringe ) there seems to be no auto complete , also with the nfringe there is no auto indentation either .
I was wondering how to fix this?
Most probably you accidentally switched into low-impact IntelliSense mode by pressing
CTRL+ALT+SPACE Just hit CTRL+ALT+SPACE to go back to the IntelliSense mode.
Are you writing a totally unmanaged C++ dll? There is no intellisense support for CLI/C++ projects in VS 2010
I have actually problems with C++ and Intellisense since VC6...
We now use Whole Tomatoes "Visual Assist" and it repairs Intellisense. :-) This single feature is the money worth.
When you open the solution file, do you get a warning about being unable to open the IntelliSense database? If so, that's the reason—UnrealEngine intentionally has a directory with the same name as the IntelliSense database to prevent its creation (Visual Studio can't create a file if a directory of the same name already exists). The engine code base is so large that having IntelliSense enabled slows everything to a crawl when you're editing code.
I'm also using Unreal Engine, and I met the same problem before, the solution was set the dirs by myself in VS project setting.
Open the property window of ur game project(e.g UDKGame), navigate to "NMake", "Include Search Path", and fill the needed header search path there.
You may copy the path list from the output of UnrealBuildTool.
The values u set here is only used by Visual Studio's IntelliSense, so there's no need to worry about build error.
This only works for C++, I'm not sure what's wrong with Unreal Script. I just updated to Visual Studio 2010 and has not installed the new nFringe.
Hope this answer is not too late