what is the usage of this header file stdafx.h? As it come along with the project created with the VS wizards.
Printable View
what is the usage of this header file stdafx.h? As it come along with the project created with the VS wizards.
It contains the most common used headers. (Why don't you open that header and read its comments?)
If you are adding your own CPP to your own VC project and you have troubles compiling(assuming your hand coded cpp uses MFC), then include stdafx.h at the very top of source before any headers.
I always remove all the stdafx junk if it exists in a project. I've never found a use for it, personally.
If it is a console project, you may remove it. But for other project types it is a no-no.
Like what other types? I never have it in a WIN32 application either. Those are the only two types of projects I've done, and I've never used it.Quote:
Originally posted by transcendental
If it is a console project, you may remove it. But for other project types it is a no-no.
It is safe to remove, if you find that it doesn't include any other headers. The 'other types' is MFC.:p ;) :D
I know it and did it too, perhaps i do not make my question clear. What i mean this those code like below:Quote:
Originally posted by transcendental
It contains the most common used headers. (Why don't you open that header and read its comments?)
Also, if I delete this file from the project workspace generated by the VC++ wizard, I need to remove the following command from the project option too:Code:#if !defined(AFX_STDAFX_H__1F8D8CC3_BD47_410A_819B_68B19F50A6CC__INCLUDED_)
#define AFX_STDAFX_H__1F8D8CC3_BD47_410A_819B_68B19F50A6CC__INCLUDED_
"stdafx.h"
me too :pQuote:
Originally posted by The Hobo
I never have it in a WIN32 application either. Those are the only two types of projects I've done, and I've never used it.