That seems a bit weird. If stdafx.h had an extra #endif you shouldnt be able to compile. In the file you are working in, check ALL the includes to make sure they have matching #ifdefs and #endifs Just because you are getting the error in this particular file, it does not mean that the actual culprit of the unmatching #endif exists in the writing verbatim what is in the include file in place of the #include statment. For Example
//********* FILE ex.h *************
#ifdef EX_H
#define EX_H
#include "abc.h"
#endif
#endif // notice the extra endif
//******* END OF EX.h ************
//******** OTHER FILE other.h *****
#ifdef OTHER
#define OTHER
#include "ex.h"
#endif
//***********************************
In this case the file other.h will give the error for an un matching endif (If i remember correctly). All I really remember is I have seen this before and the error didnt really exist in the file the compiler said it did. Also, you can compile to just the preprocessor and see what it looks like. I forget the code for this but it is in the VC++ documentation.
Matt