If your include statement uses angle brackets:
#include <stdafx.h>
...try changing it to use quotes instead:
#include "stdafx.h"
The two are different. When you use quotes you tell the compiler "ok first search the local directory, then go to the search path." But when you use angle brackets you tell the compiler "DONT look in the local directory, just search the search path." In the case of stdafx.h you want the one that is part of the project, so you want to search the local directory first.
Which brings me to a pet peeve of mine, but that's a story for another show...