Here's how to check the Microsoft Compiler's Version in C++ using macro ( preprocessor directive):
#if _MSC_VER == 1500 // Visual C++ 2008
#elif _MSC_VER == 1400 //Visual C++ 2005
#elif _MSC_VER == 1310 //Visual C++. Net 2003
#elif _MSC_VER == 1300 //Visual C++.Net 2002
#elif _MSC_VER == 1200 //Microsoft Visual C++ 6.0
#elif _MSC_VER == 1100 //MIcrsoft Visual C++ 5.0
#endif
I don't know the macro for older MS compilers, anyone knows?