Visual C++ 2.1: New Classes, Samples, Drivers, and More

First CD subscription release brings latest technology

Jonathan Kagle

March 10, 1995

What's new with the Microsoft Visual C++ development system? The big news is the availability of Visual C++ version 2.1, the first release of Visual C++ 2.0 Subscription Edition for Intel platforms.

Visual C++ 2.1 gives new functionality to the Microsoft Foundation Class Library (MFC) for both the 32-bit and 16-bit versions. The new release also adds features to the OLE Control Developer's Kit (CDK), including the ability to use MFC database classes in OLE Controls. It also includes new samples, documentation, and, of course, bug fixes.

New features

The following features have been added to the editors and wizards in this version of 32-bit Visual C++:

• Dialog editor support for new Windows common controls. You can add spin button, tab, tree view, and other common controls to dialog boxes in your Windows 95-based applications. If you want to add Windows common controls to your application, you must be running under the same operating system on which the target application will run. For example, you can develop an application under Windows NT 3.5 that will run on Windows 95, but you cannot include Windows common controls. (This will change shortly with the release of Windows NT version 3.51.)

• ClassWizard support for new Windows common controls. You can map control notification messages to MFC handler functions, and add classes derived from Windows common control classes. ClassWizard's improved layout makes these tasks easier.

• AppWizard support for simple MAPI (the Windows messaging API) and Windows Sockets.

• Complete AppWizard support for OLE Automation in a dynamic-link library (DLL).

• AppWizard support for creating a USRDLL project. AppWizard can now provide you with a skeleton CWinApp-derived object, rather than a DllMain function, as it does when creating an MFC extension DLL.

New features in 32-bit MFC

The following features have been added to MFC in the 32-bit product:

• New Windows common control classes. Currently you can use these controls only in applications that will run under Windows 95. They will also be supported by future versions of Windows NT (starting with Windows NT 3.51) and Win32s.

• Support for simple MAPI in CDocument and COleDocument classes.

• Windows Sockets classes for network programming (CAsyncSocket, CSocket, and CSocketFile).

• New 32-bit open database connectivity (ODBC) drivers for use with the MFC database classes (see the list of drivers, below).

Updated 16-bit version

This release also contains 16-bit Visual C++ version 1.52, an update from version 1.51, which shipped with Visual C++ 2.0. Visual C++ 1.52 runs on Windows version 3.1 or later and Windows NT version 3.5, and includes the 16-bit MFC version 2.52.

Besides OLE and database classes, this version includes classes for OLE control development and a number of new MFC 2.52 classes ported from the 32-bit product.

Like the 32-bit product, new features in MFC 2.52 include support for simple MAPI in CDocument and COleDocument classes; Windows Sockets classes for network programming; and new 16-bit ODBC drivers for use with the MFC database classes (see the list of drivers, below).

In addition, the 16-bit version now includes CPropertySheet and CPropertyPage, MFC classes that support "tabbed dialog boxes"—known as "property sheets" in MFC. Previously, these were available only in 32-bit Visual C++ 2.0.

New to the OLE Control Developer's Kit

The following features have been added to the CDK:

• Support for using the MFC database classes in OLE Controls. This allows you to create data-access controls using CDatabase and CRecordset classes. The database support also includes a sample program, called DB, that illustrates the use of the MFC ODBC database classes in an OLE control.

• OLE Controls that work under Win32s.

• Performance improvements, particularly in the areas of control creation and property access.

• Support for "grab handles" when controls are active.

MFC Migration Kit

Many developers have existing applications for Windows written in C. To help these developers migrate their applications to C++, Visual C++ 2.1 includes the MFC Migration Kit. The kit includes:

• An extensive MFC Migration Guide, a Help file that takes you through the migration process with both 16-bit and 32-bit sample applications using MFC.

• A migration tool (in 16-bit and 32-bit versions) that scans your C-language source code and suggests things you should do to migrate the code to MFC.

• Both 16-bit and 32-bit sample applications—before migration, in C, and after migration, in C++.

The migration tool can also help you port 16-bit applications to 32-bit, with or without MFC. The MFC Migration Guide explains where that port fits into your migration strategy.

The Visual C++ subscription program is designed to distribute all these improvements quickly and efficiently. But what if you can't buy the subscription edition because you live outside the U.S. or Canada? The Visual C++ subscription is now being launched in Western Europe. Outside Europe and North America, the CD will be available as a stand-alone upgrade through your local subsidiary. (See below, "Where's my Visual C++ 2.1 CD?")

Note: The documentation for Visual C++ 2.1 is scheduled to be included in the April release of the Developer Network Development Library.

Jonathan Kagle is a product manager for Visual C++ and Microsoft Test. In his spare time, he enjoys whittling, terrariums, and slam-dancing.

ODBC Drivers Included with Visual C++ 2.1 Release

• Microsoft Access (for Microsoft Access versions 1.x through 2.x)

• Btrieve (for Btrieve versions 5.1 and 6.x—only the 16-bit version of this driver is available)

• dBASE (for dBASE versions III and IV)

• Microsoft Excel (for Microsoft Excel versions 3.0 through 5.0)

• Microsoft FoxPro (for FoxPro versions 2.0, 2.5, and 2.6)

• Paradox (for Paradox versions 3.5, 4.0, and 4.5)

• Text (for ASCII text files)

• Microsoft SQL Server version 1.2 or later

• Oracle 6.0 or later (16-bit only)

Where's My Visual C++ 2.1 CD?

You wait by the mailbox day after day, but still your Visual C++ 2.1 CD doesn't arrive. What's the problem? There are several possibilities:

You have not activated your subscription. Despite rumors to the contrary, Microsoft ESP (extra-sensory perception) for Windows is not yet bug-free, so you must send in the activation card that came in the box (it's cleverly hidden next to the MFC hierarchy chart). If you purchased your Visual C++ 2.0 subscription from your local reseller but have not activated it, please call (800) 719-5577 or send in your subscription activation card. If you lost the activation card, call (800) 719-7577 and have your product ID number ready.

You live outside the United States or Canada. In European countries, where you can purchase the Microsoft Developer Network, make sure that your copy of Visual C++ 2.0 is registered, because you should receive a mailing that describes how to upgrade to the subscription. If you are in a hurry, you can phone the Developer Network Subscription Centre direct (see "Right Numbers" in the Columns section of this online edition of Developer Network News) to upgrade to the Visual C++ subscription. The subscription is not yet available outside North America and Europe, but a stand-alone version 2.1 should be available from your local subsidiary (part number 048-056-040A).

You bought the non-subscription edition. If you live in the U.S. or Canada, you can upgrade to the Visual C++ subscription by sending in the upgrade card in the box. If you've lost the card, call Microsoft at (800) 719-5577.

Something else went wrong. Call Microsoft at (800) 719-5577 with your product ID number.