StdAfx + Header file - Order of inclusion in MFC application

Solution 1:

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.

Solution 2:

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).