Major Changes from Visual C++ 4.2 to 5.0
Note Some features mentioned in this topic may not still exist in the current version of Visual C++.
Microsoft Visual C++ version 5.0 includes the following new features and tools:
- New C++ keywords include bool, explicit, false, mutable, true, and typename for better C++ conformance.
- You can now use __declspec to declare whether the specified storage-class attribute applies to a type or to a variable of a type.
Compiler, Linker, and NMAKE
- Compiler COM Support simplifies developing C++ clients that use COM objects. Included are samples that demonstrate using native compiler COM support. For a list of samples, see Compiler COM Support Samples.
- Compiling with /O1 provides a 5% to 10% size reduction over Visual C++ version 4.2.
- To create smaller release executables, the linker uses the /FIXED option. Because the profiler requires relocation information it must use either the linker's /PROFILE or /FIXED:NO option. This also applies to other post-link tools such as BoundsChecker or Purify.
- The new /EH compiler options give you greater control of C++ exception handling. C++ synchronous exception handling (/EHs), which allows the compiler to generate smaller code, is the new default C++ exception-handling model for Visual C++.
- The actions of the /G3, /G4, /G5, /G6, and /GB compiler options, which control which processor your code is optimized for, have changed.
- The /GX compiler option now maps to /EHsc.
- NMAKE supports Batch-Mode Rules.
- AppWizard will now automate the dialog class in a dialog-based application. Simply create a dialog-based application and select support for Automation (formerly OLE Automation). The result is a dialog-based application with basic Automation as was done in earlier versions of AppWizard. In addition, the dialog class is also exposed through Automation, via a separate proxy class. You can add methods and properties that expose elements of the dialog.
- Custom AppWizards now have the ability to modify the build settings of the project they create. For example, you can adjust the compiler, linker, and browser settings and /or add custom build steps that execute after the target is built.
- MFC Internet Programming Tasks enable your application, typically for the Internet, to download files and control properties asynchronously, thus freeing system resources for other processes while the tasks are completed.
- Active Documents can be displayed either in the entire client window of a Web browser, such as Internet Explorer 3.0, or in an OLE container — such as the Microsoft Office Binder — that supports ActiveX documents.
- Win32 Internet Extensions (WinInet) makes the Internet an integral part of any application and simplifies access to the Internet services FTP, HTTP, and gopher.
- MFC now supports DAO 3.5. MFC DAO classes (see DAO and MFC) work either with DAO 3.0 or DAO 3.5, but have not been designed to take advantage of any new DAO 3.5 features, including ODBCDirect.
- Support for ODBC 3.0 provides several important changes to the MFC ODBC classes (see ODBC Feature Enhancements).
- The return types of the COleDateTime member functions SetDate, SetDateTime, and SetTime have been changed from BOOL to int. Each of these member functions returns 0 if the COleDateTime object was set successfully; otherwise, 1. This return value is based on the DateTimeStatus enumerated type.
- A new sample program called IMAGE. This program generates an ActiveX control that is capable of downloading data asynchronously.
C Run-Time Library
- The _itoa, _i64toa, and _ui64toa functions convert digits to a null-terminated character string and store the result in a string. The _itow, _i64tow, and _ui64tow functions are wide-character versions of _itoa, _i64toa, and _ui64toa respectively
- These common floating-point transcendental functions have performance improvements that average 35% with no significant loss of accuracy: pow, sqrt, log, log10, sin, cos, tan, asin, acos, atan.
- The performance of the memmove and memcpy functions is significantly improved.
ANSI Standard C++ Library
These libraries now conform to the ANSI C++ (X3J16) Working Paper dated September 24, 1996, ANSI Doc No. X3J16/96-0178 WG21/N0996. This paper was produced by the Stockholm meeting of July 1996. See Standard C++ Library Overview.
OLE DB is a set of OLE interfaces that provide applications with uniform access to data stored in diverse information sources. These interfaces support the amount of database functionality appropriate to the data source, enabling it to share its data.
The OLE DB Software Development Kit (SDK) is a set of software components, tools, and documentation designed to help you in developing OLE DB consumers and providers for the Windows 95, Windows 98, and Windows NT 4.0 operating systems.
ERRLOOK - Look Up System Error Messages
This utility enables you look up system error messages, including OLE HRESULTs, by their value. You can drag and drop error values from the debugger, or copy and paste, or type them in. You can enter values in hexadecimal or decimal format. The error message text that ERRLOOK returns can be copied and pasted to other applications. ERRLOOK has context-sensitive help that describes how to use the utility.
New Sample Programs
Visual C++ 5.0 ships with several new samples. Microsoft Visual C++ version 5.0 Enterprise Edition provides the following new features and tools for developing and validating enterprise applications:
- Microsoft Transaction Server for building transaction-based applications.
- Visual Database Tools for graphically designing databases and SQL queries.
- Better performance while debugging a database connection: this process now runs much faster than before.
- Extended SQL data type support so you can now change the values of local variables for all SQL data types (except text and image). This includes changing the data types money and datetime. You can change the values of local variables to and from the NULL value. You can also view all SQL types including text and image.
Features New to the Developer Studio Shell
Note In version 5.0, the shell for Visual C++ was called Developer Studio.
Developer Studio includes the following new features:
- Automation and Macros
Use Visual Basic Script to automate routine or repetitive tasks. Macro recording allows quick authoring. You can manipulate Developer Studio and its components as objects. This means you can automate tasks that include opening, editing, or closing documents, or sizing windows. You can also create integrated add-ins using Developer Studio's object model.
You can create new classes using MFC, ATL, or your own classes. You can use folders to organize classes the way you want in ClassWizard.
ClassWizard also now provides the ability to view and edit interfaces for COM objects implemented in MFC or ATL.
- Customizable toolbars and menus
You can customize toolbars and menus with greater flexibility, to fit the way you work. For example, you can:
- Create a new toolbar or menu.
- Customize an existing toolbar or menu.
- Add or remove menu commands or toolbar buttons.
- Add a menu to a toolbar.
- Move a menu command to become a toolbar button.
- Move a toolbar button to become a menu command.
- Copy a menu or toolbar button on more than one toolbar, so it remains available when some toolbars are hidden.
You can connect to running applications and debug them, and use macro language support to automate the debugger.
- Project Workspaces and Files
Workspace files now have the extension .dsw (formerly .mdp). Project files now have the extension .dsp (formerly .mak).
Build files have been separated into two types: internal (.dsp) and external (.mak). Internal build files are created when you create a new project within the development environment or when you convert a project from a previous version. Internal build files are not compatible with NMAKE. You can create an external build file, compatible with NMAKE, by clicking Export Makefile on the Project menu.
The process for creating new workspaces and files is easier: you use the same dialog box to create a workspace, a project, or a file, and you can create a new item and insert it into a project or workspace at the same time.
Your projects can contain active documents, such as spreadsheets and Word document files, and you can edit them without leaving the development environment.
The file workspacename.dsw, created when you create a workspace, is a new extension. The workspace file no longer includes data specific to your local computer. Now you can:
- Add the workspace file to a source control project.
- Copy a workspace from another computer or a network directory and open the workspace copy directly, without creating a new workspace file for your local computer.
- Resource Editors
Use the WizardBar with dialog boxes to hook up code to the visual elements of your program.
The Accelerator, Binary, Dialog, and String editors support searching with the Find command to locate accelerator keys, ASCII strings, hexadecimal bytes, control IDs or labels, and specific strings.
If you are working on accelerators, dialog boxes, menus, or strings, and you need to make the same change to multiple items, you can do so by selecting all of the items you want to change and then clicking Properties on the View menu. When you have multiple items selected, the Properties command displays a Multiple Selection property page. The changes you make on this page apply to each item, and if you need to undo a change, you need to choose the Undo command only once.
- Text Editor
The editor can color extensionless header files with the proper syntax coloring.
If you want to distinguish clearly between the control and text areas of a source window, customize the color of the selection margin. This is especially useful when editing source files without much vertical alignment of elements, such as HTML.
The Find in Files command supports two separate output panes. This feature allows you to retain the output from a previous search.
- What's This Help
What's This Help is contextual, specific Help for controls in dialog boxes and windows. To use this form of Help, click the What's This button, which appears as a ? in the upper-right corner of a dialog box or window. The cursor changes to a question mark and you can then click any control on a dialog box or window to display a short help topic about the control.
There are new wizards that you can use to create files, controls, and new types of projects.