"stdafx.h" change default

Started by
9 comments, last by MichaelT 18 years, 10 months ago
Just wondering how I can change my default "stdafx.h" from: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #include <tchar.h> to #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #include <tchar.h> #include <iostream> or #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #include <tchar.h> #include <iostream> #include <conio.h> #include <math.h> Thanks, simple answer I know!
Advertisement
You could just make your own version of it. Then when you create a project that requires it, just include it into the project. [smile]
I don't believe you can change the defaults created by the wizard, but you can create your own custom wizard that will set up a project exactly how you want it. For info on how to do this, look here.
Quote:Original post by rpg_code_master
You could just make your own version of it. Then when you create a project that requires it, just include it into the project. [smile]


Right, but by default it includes "stdafx.h" now say I no longer need that header file and i need mine "mynewheader.h" instead by default allthe time, how would I go about doing that. Having "stdafx.h" would create overhead I wouldn't need. Basically I am trying to do less code by not typing my #includes everytime I start a new project. I am not trying to be lazy I'm just trying to optimize what I have and what I can do..that's all.

BTW - I am looking into the Custom Wizard creation now.

Thanks!

Ahh the custom wizard isn't working yet, not implemented in 2005 beta, but thats ok I have 2003.net at home and will give this a shot again. Thanks again!
Quote:Original post by Dave Hunt
I don't believe you can change the defaults created by the wizard, but you can create your own custom wizard that will set up a project exactly how you want it. For info on how to do this, look here.


Oh, it would be dangerous but at least it seems you can (vs.net): check out {vs.net2003}\Vc7\VCWizards\mfcappwiz\Templates\1033 (where {vs.net2003} is your install directory): it contains a stdafx.h file which can be customized.

Again: I wouldn't do it if I were you (or at least, do a backup before modifying your files).

Regards,
I'll look into that, I have a test machine with it installed so, I can run what ever I want haha. Thanks! What do you guys normally do, just type in all your header files? Obvioulsy when your working with big applications yea, but what about when you study and use the same header files for each project, what do you guys normally do?
I do them by hand as needed, and I don't use pre-compiled headers. They cause too many synchronization problems in VS.
So when creating a new project do you just create new files and make all your own files, then save them to one folder?

I guess that will help a lot in terms of all the junk VS creates by default, but I am sure they ahve there purposes. Thats the way I did it in VS6.0
I use the wizard and tell it to create an empty project. Then create files as needed.

This topic is closed to new replies.

Advertisement