Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

23 May 2007

How to detect version of MS Visual Studio or compiler in compilation time

To do this you should use _MSC_VER define like in this code:
#if _MSC_VER >= 1400 // this is Visual C++ 2005
#elif _MSC_VER >= 1310 // this is Visual C++ .NET 2003
#elif _MSC_VER > 1300 // this is Visual C++ .NET 2002
#endif

Convert Visual Studio 2005 solution and project to VS 2003 format

In some cases you would need to convert somebody's project in VS 2005 format into format of your VS 2003. There are no such convertion tools build into new or old studios. The solution is to download UnPrjConvertor application from this page. You can run this app to convert VS2005 solution into VS2003 or VS 6.0 formats. Also it converts projects .vcproj into .dsw format. But I can't to convert VC project file from VS2005 to VS 2003 format by this application. I've found that you just need to change version of file format in the .vcproj file from 8,00 to 7,10 and this file will successfully load in 2003 studio. Some of these projects will compile, some not, but most of them wiill.