visual studio project template

Hi all, I got two noob questions regarding visual studio (2017):

1. I am looking for a way to create a default project configuration so i don't have to set it up each time i make a new project (intermediate directory location etc)

2. is this done through project template? what exactly is project template?

thx!
Hello sstavrou,

Not that I have done this my-self yet yo might try starting with https://msdn.microsoft.com/en-us/library/xkh1wxd8.aspx

One thing I did do is to change a file used to create a project. It can be found with this path: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCWizards\AppWiz\Generic\Application\templates\1033\root.cpp". I have since lost the path for VS 2017 as my installation did not work the first time, but that was early in the release of 2017 so I thought I would give it some time to get any bugs worked out before i tried again.

The above computer path is for VS 2015 and your path may be slightly different. The "root.cpp" file is used to generate the necessary code based on the wizards input. After making a backup copy of the file I worked on the original file until I had what I wanted.

Be advised there are two sections that you may want to change. One at the top that starts:
1
2
3
4
[!if CONSOLE_APP]
//  [!output PROJECT_NAME].cpp : Defines the entry point for the console application i.e., main function
[!endif]
Put your changes here

And at the end of the file that starts "[!if CONSOLE_APP]" with two "[!endif]"s at the very end of the file.

One or both of these methods should work for what you want.

Hope that helps,

Andy
Hi thanks for the reply.

Actually, i played around with project templates:

I made a blank project, modified all the setup i wanted (output, intermediates locations) and i also created a main.cpp inside src folder which i also created. added some minor code inside main. then i exported as a template and deleted the project. i created new project using this template (it appeared in the new project options list)

so what i got was my configuration setup as i had it modified! :)
i also got an src folder
i got a main.cpp appearing inside project filters
but... i got no actual main.cpp in file system! this must be a bug?

ofc i tried adding it manually and VS complained that it already exists
when tried to delete it from filter, VS complained file is not found! pls VS make up your mind :)
Last edited on
it's a really weird environment to work in but I've gotten the GUI builder to work. Kind of. So far playing sounds with buttons is about all I've done. I'm gonna have to get a book devoted to just this version I fear - a lot of the online resources seem directed to older versions, or directed to teaching C++ CLI style in VS, rather than teaching how to use VS to make programs with an actual Windows GUI.
Topic archived. No new replies allowed.