Cannot associate .hpp, .cpp extensions with visual studio 2017RC in Windows 10 - c++

You know my question. Here is the longer version. Downloaded 2017RC, it took me a day to set it up to work with UCRT, CMake, Google test and all the goodies. Then I tried to associate the usual hpp, h, cpp extensions two ways:
Control panel -> Default Programs -> Set Default Programs, choose Visual Studio 2017RC and then -> Set Program Associations where all the possible extensions that can be handled by this program are listed. None of the usual C++ extensions are listed.
Right click on a .cpp file, Open with, visual studio 2017 RC doesn't show up in the apps list, hunt it down and click on it. A dialog box pops up saying that The program you have chosen cannot be associated with this file type.
FYI, currently all the c, C++ extensions are associated with Qt. Am I to think that RCs are not expected to have this feature? Or is it some other sub-program within VS, with which the association should be made? Thanks for your help

I had the same problem for Visual Studio 2015. The answer here is a good starting point:
https://superuser.com/questions/977271/windows-10-visual-studio-2015-xaml-file-association
Specifically, modifying "HKEY_CLASSES_ROOT.cpp". I changed the (Default) String value to VisualStudio.cs.14.0 and it now opens .cpp files in Visual Studio 2015.
You would have to use whatever version Microsoft has for Visual Studio 17. Take a look at an existing working file extension to see what it uses.
As usual, backup everything before messing around in the Windows registry.
For what it's worth, Microsoft appears to have fixed this bug, and will apparently be releasing the fix in the next release:
https://developercommunity.visualstudio.com/content/problem/3122/vc-file-association-not-correct.html

Related

Not able to create VC++ project Visual Studio 2015 Community

I am unable to create a VC++ project in VS2015 Community. When I attempt to do so, I get two messages starting with, 'The "Visual Studio C++ Project System Package" did not load correctly.' Then this fatal message appears:
I also have VS2005 Professional installed on my machine; I need the two for different projects.
This seemed similar to not able to create VC++ project, with VS11 so I created a batch file that sets those env vars and then calls devenv.exe for VS2015. Still got the same error messages.
Visual Studio 2015 (community)- cannot create new project c++ suggests an incompatibility between two versions and to delete an old directory. But as I need both versions, that does not seem to be a good solution either (and suggestion didn't appear to help that OP).
As final data points, Intel Visual Fortran 2017 is installed and integrated with VS2015, and I note that a resulting VFPROJ file is in the pre-VS2010 format - .vcproj format with <VisualStudioProject> being an element.
At any rate, I cannot create a new project inside VS2015 for C++ and would appreciate your help towards a solution.
I chose Repair for on VS2015 under Control Panel - Programs and Features and I am now able to create a C++ project. I will continue testing by creating a nother Fortran project and if it causes the problem to recur I will repost.

Visual Studio 2015 (C++) : Stop compile on first build error (not first project)

How to stop the compilation of Visual Studio 2015 when it detects compile error?
I mean first build error (may be first .cpp), not first project because it takes too much time.
(I have only 1 project.)
An extension named "StopOnFirstBuildError" is not an answer,
because it stop on first project that has error.
Question
(more elaborate)
When I pressed F5 or Ctrl+Shift+B, the compiler would compile all (or some) files.
In my case, it can detect some errors using only 5 seconds, so I want it to stop compiling NOW.
However, the VS 2015 become non-responsive.
It also has strong resistance against Ctrl+Break.
It takes about 30 seconds before I can navigate to the location of error.
How can I stop the compile-process on the first compile error automatically?
History
There is an old thread asked about this for Visual Studio 2008.
Its most accepted solution is to go to :-
Visual Studio -> Tools -> Macros -> Macro IDE... (or ALT+F11)
and paste a certain piece of code.
However, macro is not supported anymore in VS 2012.
(I tried to press Alt+F11 in VS 2015, no macro editor / menu appear.)
The claim is consistent with a question for VS 2010 stated that the above trick is not work.
The solution for the VS2010 question is to install an extension named "CancelFailedBuild".
Thus, I downloaded it.
When executed .vsix (the installer), it said
"This extension is not installable on any currently installed products.".
... it makes sense because the extension said "Works with : Visual Studio 2010, 2012".
Now I think I am left with a single choice :-
Use macro (the old VS 2008 way) by installing Macros extension.
(The extension is a result of users' complain about losing the old macro feature.)
Is downloading the extension a good idea?
If so, what is the step after that? Is there a code that I should copy-paste?
If not, what is the easier way?
Sorry for posting a lot of hyperlinks.
Workaround
Below are the approaches that may alleviate some inconvenience, but do not answer the actual question at all.
Install a patch that make Visual Studio responsive, so Ctrl+Break works.
It requires me to press keyboard manually.
It seems to work only for Windows 7. (not tested)
Shorten compile time by creating a simple dummy .cpp, then compiling only that single file.
It is useful for some cases.
The solution for the VS2010 question is to install an extension named "CancelFailedBuild".
...
This extension is not installable on any currently installed products.
...it makes sense because the extension said that "Works with: Visual Studio 2010, 2012."
Visual Studio 2012 extensions are frequently compatible with VS2013 and VS2015. You can update the extension yourself by unzipping the .vsix file (it's just a ZIP archive) and updating its manifest (which is an XML file).
This guide shows you the XML elements to change.

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

How to update MFC source code?

After several Visual Studio patches and a service pack or two, my MFC source code no longer matches my MFC binaries. When I trace into MFC, I either see assembly or old source code.
How do I get my MFC sources to match my binaries again?
Since there are no other answers I'll tell you the obvious (and the most painful) one. Reinstall everything. And if possible install Visual Studio with SP slipstreamed.
Although I don't know what you meant by "old source", I don't think there were any changes to MFC between Visual Studio 2005 and SP1. But I might be mistaking.
I'm not sure why it's not picking it up automatically - when you build a dll, the source location is stamped in the pdb. Anyway, try setting the source file path in Visual Studio to first point to the "updated" MFC source. If that doesn't work, step into the MFC function again (so you get the "incorrect" source), then close out that file, then browse to and open the "correct" source file. See if the debugger jumps to the appropriate location then.
There are a number of updates from the MS download centre, searching MFC. but the only one mentioning source is the OLEUI2.cpp update to VS.Net 2003. Maybe it hasn't actually been changed but does need recompiling?