The following libraries included in Visual C++ .NET are either new or have changed.
- Active Template Library (ATL)
- ATL Server
- C Run-Time Library
- Microsoft Foundation Classes (MFC)
- OLE DB Templates
- Shared Classes
- Standard C++ Library
- Old iostream Library
- The default settings for ATL projects have changed. See Default ATL Project Configurations for details.
- More reference topics for ATL methods contain code examples.
- Support for collections and enumerators: ICollectionOnSTLImpl, IEnumOnSTLImpl, CComEnumImpl, CComEnumOnSTL, CComEnum
- A new class, CImage, that provides enhanced bitmap support, including the ability to load and save images in JPEG, GIF, BMP, and Portable Network Graphics (PNG) formats.
- New classes for managing arrays, lists and trees: CAtlArray Class, CAtlList Class, CAtlMap Class, CRBMap Class, and CRBMultiMap Class.
- New string conversion macros and classes: ATL and MFC String Conversion Macros.
- Utility classes: CAdapt
- Hosting ActiveX controls: IAxWinAmbientDispatch, IAxWinHostWindow, CAxWindow2
- Enhancements to CComBSTR and CComVariant
- New macros: OBJECT_ENTRY_AUTO and OBJECT_ENTRY_NON_CREATEABLE_EX_AUTO
- Simplified object creation: CComCoClass::CreateInstance
- Improved debugging support: _ATL_DEBUG_INTERFACES
- Registry support for REG_MULTI_SZ values: CRegKey, Creating Registrar Scripts
- New security classes: CAcl, CDacl, CSacl, CSecurityAttributes, CSecurityDesc, CSid, CTokenGroups and CTokenPrivileges.
- New array management classes: CSimpleArray, CSimpleMap, CComSafeArray, CComSafeArrayBound.
- A Currency object class: CComCurrency.
- The following ATL macros should be considered obsolete: atlTraceFlags, ATLTrace, BEGIN_OBJECT_MAP, OBJECT_ENTRY, END_OBJECT_MAP.
- Several ATL methods have been replaced: for details see the section "Deprecated ATL Functions" in Obsolete ATL Topics.
- The functionality of CComModule has been distributed into several new classes; see ATL Module Classes for details.
ATL Server is a set of native C++ classes that allows developers to create Web applications, XML Web services, and other server applications. Many classes can also be used in client applications or components.
- Run-Time Error Checks Functions
- The new operator can throw an exception or return zero if the memory allocation fails. See The new and delete Operators for more information.
- Recover from stack overflows with _resetstkoflw
- New functions to allow dates beyond the year 2038:
- Configure debug-heap checks with _CrtSetDbgFlag.
- Determine block and subblock types _CrtReportBlockType
- Math Constants
- New wide-character functions:
- New __int64 versions of string functions:
- New Unicode versions of console functions:
- New string functions that calculate the number of characters needed to print formatted data:
- Data Alignment functions.
- _set_security_error_handler, for registering a security error handler.
- Because the timing of the release of C99, this version of Visual C++ is not conformant with that standard.
- New byte-swapping functions: _byteswap_uint64, _byteswap_ulong, _byteswap_ushort.
- _set_SSE2_enable to use SSE2 instructions.
- Reference topics for MFC contain hundreds of new code examples.
- Static Casting and MFC Message Maps Beginning with Visual C++ .NET, MFC provides stricter type checking for return and parameter types of message handler functions. This new behavior notifies the developer of potential problems by flagging potentially unsafe message handlers with an error message. MFC now uses static casts for ON_MESSAGE, ON_REGISTERED_MESSAGE, ON_THREAD_MESSAGE, and ON_REGISTERED_THREAD_MESSAGE.
For example, in the past a developer could use a member function that returned void instead of LRESULT for ON_MESSAGE or ON_REGISTERED_MESSAGE and compile without any errors. With Visual C++ .NET, the potential miscast is caught and flagged as an error. The developer can fix the potential problem by replacing the return type (with LRESULT) and recompiling.
- DHTML editing component: CHtmlEditCtrl, CHtmlEditView, CHtmlEditDoc
- DHTML dialog boxes: CDHtmlDialog, CMultiPageDHtmlDialog
- ISAPI support for parsing argument lists: CHttpArg, CHttpArgList
- Support for windowless controls: COleControlSite, COleControlContainer, and COccManager
- Enhanced support for using HTML Help in an MFC application: Displaying the Help Viewer.
- Windows 2000 print property sheet: CPrintDialogEx.
- DAO support: The Visual C++ MFC Application Wizard and MFC DLL Application Wizard no longer support DAO database projects. You can still add DAO-derived classes using the Add Class Wizard. Microsoft recommends using OLE DB or ODBC for new native C++ projects. You should use DAO only in maintaining existing applications.
- TRACE0, TRACE1, TRACE2, and TRACE3 are now considered obsolete; use ATLTRACE2. TRACE now has the same functionality as ATLTRACE2.
- When selecting a dialog box font, use MS Shell Dlg, not MS Sans Serif or Helv fonts. Previous versions of MFC would automatically replace MS Sans Serif or Helv with DEFAULT_GUI_FONT or the system font, but MFC no longer does that. See General MBCS Programming Advice.
- Enhanced support for localized resources in satellite DLLs: Localized Resources in MFC Applications: Satellite DLLs.
The following OLE DB Templates are provided in Visual C++:
New Consumer Classes
New Consumer Macros
- COLUMN_NAME* macros for binding to a specific column in the database by name.
- BLOB* macros for binding binary large objects (BLOB).
New Provider Classes
New 64-bit Data Types
Methods in several OLE DB Templates classes have been changed to use the new 64-bit data types instead of the old 32-bit ones. The documentation has been updated to reflect these changes. In case of discrepancy between the documentation and the header files (atldb.h, atldbcli.h, and atldbsch.h), the header files contain the most current parameter types.
For more information, see What's New in the MDAC SDK.
Breaking Changes from Visual C++ 6.0 to Visual C++ .NET
Breaking changes in OLE DB Templates from Visual C++ 6.0 to Visual C++ .NET are listed below. You can find more information on changes in the OLE DB Templates as described in the Knowledge Base article "INFO: Porting Issues with Visual Studio .NET OLE DB Provider Template Classes" (Q321743). You can find Knowledge Base articles on the MSDN Library CD-ROM or at http://support.microsoft.com/support.
OLE DB Consumer classes and templates:
As a general note, the accessor class must implement additional members. This is only necessary if you implement your own accessor class manually. If your accessor class derives from CAccessor, you need not do this.
|Visual C++ 6.0||Visual C++ .NET|
|CRowset is a class.||CRowset is a class template and takes one parameter, TAccessor, an accessor class.|
|CBulkRowset is a class.||CBulkRowset is a class template.|
|The base class for CArrayRowset was a template parameter (default value was CRowset).||CArrayRowset always derives from CBulkRowset.|
|CDynamicAccessor::GetColumnInfo took three parameters.||CDynamicAccessor::GetColumnInfo has a new form that takes an additional parameter, ppStringsBuffer. Using this parameter eliminates a memory leak. The old method is deprecated.|
|Rowset, second parameter of the CAccessorRowset template, is a rowset class.||TRowset, second parameter of the CAccessorRowset template, is a rowset class template.|
|Rowset, second parameter of the CTable template, is a rowset class.||TRowset, second parameter of the CTable template, is a rowset class template.|
|Rowset, second parameter of the CCommand template, is a rowset class.||TRowset, second parameter of the CCommand template, is a rowset class template.|
|DEFINE_COMMAND macro||DEFINE_COMMAND macro is deprecated. Use DEFINE_COMMAND_EX instead.|
OLE DB Provider classes and templates:
The internal implementation of many interfaces and methods has changed since Visual C++ 6.0. This may cause compatibility issues depending on whether your application overrides these methods.
|Visual C++ 6.0||Visual C++ .NET|
|The rowset/accessor implementation used CSimpleMap/CSimpleArray classes. User-provided collection classes had to be CSimpleMap/CSimpleArray compatible.||The rowset/accessor implementation uses CAtlMap/CAtlArray classes. User-provided collection classes have to be CAtlMap/CAtlArray compatible. In addition, code that calls methods of these collection classes should be reviewed as there are significant differences between the CAtl* and CSimple* classes (parameters, return values, and so on) that can result in run-time errors.|
|ICommandImpl derived from ICommand.||ICommandImpl is a template that derives from the template's CommandBase argument (the default is ICommand).|
|ICommandTextImpl derived from ICommandImpl<ICommandImpl<T>.||ICommandTextImpl derives from ICommandImpl<ICommandImpl<T, ICommandText>. Note that here ICommandImpl derives from ICommandText (not the default ICommand).|
A number of new and revised classes can now be used in any C++ program. For details, see the Shared Classes.
The Standard C++ Library has been updated:
- hash_map Class
- hash_set Class
- Optional exception handling support.
- Enhanced code formatting (readability).
- Enhanced DLL support (passing objects between process boundaries).
- Enhanced multithreading support.
- Enhanced compliance with the standard.
- Information about Breaking Changes In the Standard C++ Library.
For Visual C++, the use of the old iostream library is deprecated; you will get a warning each time you use an iostream function. It is possible that the old iostream library will be removed in a subsequent release.