Here is the list of MAJOR breaking changes to be aware of when moving from VC 7.1 (Visual Studio 2003) to VC 8.0 (Visual C++ 2005).
Pretty old information but there was no page that listed everything (important) on a single page with contextual info. For a FULL of C++ changes consult MSDN.
New features in Visual Studio 2005 will be a separate (bigger) post .
Breaking Changes in Environment
1. VS 2005 removes the support for 95 and NT.
2. Single Threaded C Run time library support is not available anymore.
3. New versions of common shared DLL’s introduced. Mixing code that uses different DLL versions could cause issues.
4. Application and library deployment model has now -> changed. Core run-time DLLs will now have to be stored in the system cache (WinSxS) as side by side assemblies or as private assemblies and applications can link to the DLLs ONLY by describing them using application manifests (generated and embedded automatically into the binary by VS 2005). More info here . Some programmatic info about manifests here.
5. A new run time DLL (MSVCP80.DLL) is required for applications linking against the DLL version of CRT
NOTE : These are the new common DLLs – MSVCR80.dll, MFC80*.dll, ATL80.dll, MSVCP80.DLL. The version number used is 8.0.50608.0. (This is shipped with Vista too) However your app might link to other versions during compilation due to policy redirect.
NOTE: The version nos for the version of the DLLs installed by Visual Studio 2005 SP1 is 8.0.50727.762. If these are not present your app will not run.
Breaking Changes in C++ / Features that show new behaviour
1. Security is now officially supported.🙂 Expect loads of Deprecation warnings for ANSI C string routines. define _CRT_SECURE_NO_DEPRECATE and _SCL_SECURE_NO_DEPRECATE to shut up the compiler. The best way to do this to put them up in the pre-processor directives section rather than figuring out which include file gets included from all sources.
2. Visual Studio supports lots custom non-ANSI C methods. But the naming convention for those functions is supposed to be _fn(). If you where using them without the leading underscore you will get warnings.
1. new will now by default throw an exception if it fails instead of returning NULL which was the wrong and standard behavior up until now. (Vanilla 2005 has a bug which causes release version to throw and debug version to return null. This has been fixed in SP1. Another reason why you should install SPI + have a catch block for new)
4. CRT functions now have SAL – ie Standard C functions can now validate their input parameters and will throw asserts in debug mode if used wrongly. This is helpful for catching more errors.
5. std::time_t is now 64 bit (up from 32 bit)
6. STL now supports iterator debugging and checks. Debug builds will have STL iterator debugging enabled by default. This will throw asserts and cause failures in in-correct code and help to ensure correctness in code. It can be set back by using _HAS_ITERATOR_DEBUGGING=0 and SECURE_SCL=0(not recommended)
7. wchar_t used to be #define to unsigned short. Now it is a built-in type and can be controlled via project settings. So code that treats unsigned short as wchar_t will now break due to type mis-match. You will get linker errors, if related modules treat this setting differently, coz the C++ name mangling scheme will generate different linkage names depending on the wchar_t type.
8. Many CRT functions now set errno, where they never used to set any before. This is good for debuggability but bad for code that delayed their errno checks.
9. Processor architecture specific optimizations has been removed and a blended architecture is targeted. If your binary has some subtle bugs and where hidden due to the specific binary produced, it might now surface.
COMPILATION ERRORS / REMOVED FEATURES
1. global functions and variables that reports OS versions from within CRT is now gone.
2. Some C++ functions like strstr now return const pointers instead (eg strstr)
3. You now need to use the address of operator to get the class member function address. Link
4. Managed C++ support is now dropped which has been replaced by C++/CLI.
5. Exception class has been moved to std namespace.
ps : Here is a brief List of Visual Studio and .NET versions