#include "stdafx.h" must be at the top of every source file. That's all.
If you want to know more, search about precompiled headers. Specifically for Visual Studio.