Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ New File Issue in Visual Studio Express 2015

I have a peculiar issue in Visual Studio Express 2015. I am trying to create a new empty Win32 Console Application project in Visual C++. I can create a new project, clear the check boxes for precompiled headers and SDL checks as well as check the box for "Empty Project". The project is created, but when I go to add a new item to my source files, I have nothing to choose from under "Installed". Under previous versions, I could choose a new blank C++ (.cpp) file or a Header (.h) file. I can create new .vb files under Visual Basic and new .cs files under C#, but the "Add" button is grayed out when I try to create a new C++ file. Anybody got any ideas? I've installed this on three different computers with the same results (Windows 7 OS on all 3). I've attached a screenshot of the Add new item dialog.

screenshot

like image 318
Dack Phillips Avatar asked Apr 08 '16 02:04

Dack Phillips


People also ask

How do I get C to work in Visual Studio?

Download & Install the C/C++ Extension We need to click on the extension button that displays a sidebar for downloading and installing the C/C++ extension in the visual studio code. In the sidebar, type C Extension. In this image, click on the Install button to install the C/C++ extension.

Does visual studios support C?

Yes, you very well can learn C using Visual Studio. Visual Studio comes with its own C compiler, which is actually the C++ compiler. Just use the . c file extension to save your source code.

How do I open a new file in Visual Studio?

If the Visual Studio development environment is already open, you can create a new project by choosing File > New > Project on the menu bar. You can also select the New Project button on the toolbar, or press Ctrl+Shift+N.


3 Answers

What worked for me was to copy all the files except the Utility directory from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCProjectItems_WDExpress into C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcprojectitems

When I added an item (Right click on Source Files directory in Visual Studio Express Solution Explorer), all the cpp items were available.

like image 193
Tom Hall Avatar answered Oct 05 '22 13:10

Tom Hall


I encountered this problem after downloading and installing Visual Studio Express 14.0 on April 16 2016. This seems to be the re-emergence of a problem encountered in earlier versions of Visual Studio Express. This is a link to a workaround for version 12.0, involving a straightforward edit to the registry:

[HKEY_CURRENT_USER\Software\Microsoft\WDExpress\12.0_Config\Projects{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC943}\AddItemTemplates\TemplateDirs{F1C25864-3097-11D2-A5C5-00C04F7968B4}/1]

"TemplatesDir"="C:\Program Files (x86)\Microsoft Visual Studio 12.0\\VC\VCProjectItems_WDExpress"

I followed the instructions except for altering the version number from 12.0 to 14.0 where relevant, and it solved the problem.

Possibly the problem arose because alongside the installation of Studio Express, it seems that a Microsoft Update updated the Microsoft Visual C++ Redistributable (x64) and (x86). The consequence was an error message at the end of the Studio Express installation, because the version number of these installed C++ components was higher than those included in the Studio Express download. Deinstalling the later versions and then rerunning the Studio Express installation was successful in so far as there was no error message, but this problem with New Item was there.

like image 36
hutch Avatar answered Oct 05 '22 13:10

hutch


I did ALMOST the same as Mr. Hill

I copied the whole directory and renamed the copied directory to the second one. I found it wasn't even in the directory. I am Windows 10 Home Edition. ... also trying to get back up to speed to the latest VC Studio and Windows, .... don't laugh but I'm very happy with V6.0 and Win XP, but I can't keep supporting Windows XP forever. See changes at the bottom of my post.

Btw all the apps that I make in V6.0 work in Windows 10: As Databases, I'm using my own database made from fopen,fwrite, sqlite and Dao MSACCESS 97. There is one app that I have to port to MFC. It's not necessary that I upgrade to the Latest VStudio at the moment, But I'm going to be doing it. Can't live in the past forever,... well maybe lol?

Also, I don't like the new GUI features of WINDOWS 7 and WINDOWS 10. My recommendation to MICROSOFT is to make Windows 11 with a look and feel more like Windows XP(or at least a switch to give users that option) but of course they will be obligated to add new features to keep up with technology. I don't like all the pop-ups on rollovers and the new files control dialog.

..sorry for the types: These new PCs and WINDOWS 10 are very cumbersome with all the pop up that appears when you do rollovers.

Thanks to everyone on this thread, and special thanks to Mr. Hill

Chaneges to system:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCProjectItems_WDExpress into C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCProjectItems

like image 31
AL DURAN Avatar answered Oct 05 '22 12:10

AL DURAN