2

I'm working off of a branched project in VS2015, and every time I create a new class file from the default template, it adds #include "stdafx.h" by default. The solution does not use precompiled headers, and has no such file.

It appears the project was originally created with the precompiled header option enabled, and it was disabled afterwards. Is there a way to stop this line from being added to new files that are created with the default class template?

For the record, in the properties, under C/C++ -> Precompiled headers:

Precompiled Header:              "Not using Precompiled Headers"
Precompiled Header File:         <blank>
Precompiled Header Output File:  <blank>
Aaron Schultheis
  • 419
  • 2
  • 10

1 Answers1

0

generation of class structure is not managed by a single project. Even though you changes your project properties to "Not Supported" pre compile header files this will not help to stop creation of .CPP file with stdafx.h support.

To customise your class creation wizard you have to modify "default" file present at "C:\Program Files\Microsoft Visual Studio 14.0\VC\VCWizards\CodeWiz\Generic\Class\Scripts\1033" location.

Following are certain examples resides on stackoverflow and MSDN for your reference.

Santosh Dhanawade
  • 1,756
  • 14
  • 29
  • I've noticed that creating a new project without precompiled headers will omit the #include "stdafx.h". Would this not indicate that there is some type of project configuration somewhere that can be done to identify how the default wizard treats class generation? I'm hesitant to modify any default files in my VS installation, and creating an entire new wizard seems like overkill for such a small change. Is there no simpler way to approach this? – Aaron Schultheis Oct 04 '18 at 12:54