StdAfx + Header file - Order of inclusion in MFC application

前端 未结 2 1721
陌清茗
陌清茗 2020-11-30 15:54

I am using Visual Studio 2005. I created an MFC based console application named \"StdAfx dependancy\". The IDE created the following files for me.

  1. Resource.h
相关标签:
2条回答
  • 2020-11-30 16:02

    In addition to ckv's answer, it makes little sense to include header files before "stdafx.h" as any non-trivial header file will contain framework types that are included there (e.g. any MFC types).

    0 讨论(0)
  • 2020-11-30 16:13

    This link must give you some clue. Purpose of stdafx.h

    The lines defined before the #include "stdafx.h" are ignored by the compiler. So if you want to actually include those files then you need to include them after the #include "stdafx.h".

    Hope it is clear.

    0 讨论(0)
提交回复
热议问题