Share via


Changes in the Visual C++ 2005 Libraries

The following sections discuss the updates and breaking changes to the libraries that are shipped with Visual C++.

In this Section

General Libraries Changes

Breaking Changes

In mixed mode, native constructors are called before managed constructors. For a single executable, the constructors of all native global objects will be called before the constructor of any managed global object, regardless of whether the native and managed objects exist in the same compilation unit.

Therefore, applications relying on managed constructors being called before native constructors may function in an incorrect manner.

If there are dependencies between global objects, you should ensure that only dependencies from managed objects to native objects exist. The best way of ensuring that an object is managed or native is to put it into a compilation unit that is built that way.

Libraries Changes to Support Manifest-Based Assembly Generation

As of Visual C++ 2005, the Standard C++ Library and the ATL, MFC, and CRT libraries are side-by-side shared assemblies with manifests. Similarly, the compiler and linker settings now default to manifest generation using mt.exe. This will ensure that all Visual C++ executables have a manifest that refers to their dependence on ATL, MFC, and CRT. For detailed information, see Visual C++ Libraries as Shared Side-by-Side Assemblies, Deployment (C+), and Building C/C++ Isolated Applications and Side-by-side Assemblies.

If you use makefiles to build your projects, see How to: Embed a Manifest Inside a C/C++ Application.

Library Support for Mixed Assemblies

Visual C++ 2005 supports the use of the Standard C++ Library and the ATL, MFC, and CRT libraries as mixed assemblies compiled with /clr. These mixed libraries allow you to use all of their existing functions when your code contains a mixture of native code and MSIL-based __clrcall code. For more information, see Mixed (Native and Managed) Assemblies.

Initialization of Mixed Assemblies

The library support changes in Visual C++ 2005 resolve the "loader lock" issues that applied to mixed DLLs in Visual C++ .NET and Visual C++ .NET 2003. However, there is still a restriction that your DllMain code must never access the CLR. For more information, see Mixed (Native and Managed) Assemblies.

Libraries not Supported by Pure Mode Compilation

In Visual C++ 2005, the ATL and MFC libraries are not supported by pure mode compilation (/clr:pure).

See Also

Concepts

Changes in Visual C++ 2005 and Earlier Editions