Export (0) Print
Expand All

Changes from ATL Version 2.1

Visual Studio .NET 2003

This topic summarizes important changes from ATL 2.1; ATL 2.1 shipped in Visual C++ 5.0.

ATL 3.0 shipped in Visual C++ 6.0. ATL projects that compiled in Visual C++ 6.0 will compile in the current version.

For more information on version numbers, see ATL and Visual C++ Version Numbers.

IObjectSafetyImpl

In ATL 2.1, the IObjectSafetyImpl class marked the control as being safe for scripting. For security reasons, this default has been removed, so you must explicitly specify your safety options using the second template parameters. You must now expose this class using COM_INTERFACE_ENTRY rather than COM_INTERFACE_ENTRY_IMPL.

_ATL_NO_UUIDOF

ATL 3.0 uses the compiler keyword __uuidof( class ) to obtain the corresponding IID for a given class. Because of changes in the COM_INTERFACE_ENTRY macros, now you simply include the header for the interface to use, instead of also linking to a library that defines the matching IIDs for that interface. This change can cause problems if the header was previously generated by an old version of MIDL, or if it was hand-coded and not marked appropriately.

If the declaration for the interface in the header has not been marked with an associated __declspec(uuid), then any attempt to use the __uuidof() keyword for that interface will fail. You can revert to the old style (ATL 2.x) COM_INTERFACE_ENTRY macros by defining _ATL_NO_UUIDOF in your build settings to work around any problems with this new behavior.

New _ATL_DEBUG_INTERFACES

In addition to _ATL_DEBUG_QI and _ATL_DEBUG_REFCOUNT, present in ATL 2.x, there is the new _ATL_DEBUG_INTERFACES, which will trace to the debug console any interface leaks that are detected when _Module.Term is called (when the server shuts down).

Obsolete Macros

Macro Comment
COM_INTERFACE_ENTRY_IMPL Obsolete. Replace with COM_INTERFACE_ENTRY.
COM_INTERFACE_ENTRY_IMPL_IID Obsolete. Replace with COM_INTERFACE_ENTRY_IID.
CHAIN_MSG_MAP_ALT_DYNAMIC Obsolete and deleted.
BEGIN_PROPERTY_MAP Obsolete. Use the new property map macro BEGIN_PROP_MAP.
END_PROPERTY_MAP Obsolete. Use the new property map macro END_PROP_MAP.

See Also

Upgrading Your Program | ATL Debugging Techniques

Show:
© 2014 Microsoft