pinMicrosoft Visual C++ Strategy

Overload Journal #5 - Sep 1994 + Programming Topics   Author: Microsoft

Overview

A History of Innovation, a Path to the Future

March 1994 Visual C++ Strategy

The Microsoft Visual C++ development system family of products meets the need of developers to develop sophisticated Windows-based applications quickly. It also protects existing investments in the Microsoft Foundation Class Library (MFC) and the Windows API and establishes a clear path to developing 32-bit applications for Windows that run on multiple software and hardware platforms.

With the Visual C++ development system family of products, Microsoft’s strategy is to provide the shortest path for developers to access the full power of Windows, the smallest and fastest executables, and the safest investment for the future.

These fundamental principles have guided the development of Visual C++ and will continue to do so in the future. In order to deliver on these promises, we have chosen to focus our development efforts as follows:

C++ is the language we will focus on for the long term. We will implement new features in the language as standards emerge. However, in order to reduce the complexity that C++ brings with its power, we will implement a subset of the language in our class library and minimise the work involved in creating Windows-based applications in C++.

We believe that the greatest gains in productivity can be achieved through the use of a well-written class library. A key element of Visual C++ is the MFC architecture, which not only provides the fundamentals for developing Windows-based applications but also provides significant amounts of reusable code that developers can use in their applications. In addition, we have designed the Visual C++ development environment so that developers can easily exploit the full power of MFC.

Improvements in the development environment and build throughput provide the next level of productivity gains. Visual programming tools, integration and task orientation are the key areas of focus for achieving this objective with Visual C++.

Microsoft continues to lead the industry in C and C++ optimisations to help create the smallest and fastest executables possible. We have tuned MFC so that developers incur very little overhead in developing applications using C++ and MFC compared to using C and the Windows SDK.

Tools are provided for all the platforms supported by the Windows family. MFC and the tool set support all the latest features of the Windows operating system so that developers can take advantage of these features in their applications.

It is essential to preserve customers’ knowledge base and their investments in code into the future. For that reason, the MFC architecture is built around the Windows API to utilise existing knowledge. Existing applications based on C and the Windows API can be migrated to C++ and MFC. Once developers invest in MFC, their investment is completely protected from version to version and platform to platform.

Visual C++1.0:The move to C++

Research into developer needs defined the major design goals of Microsoft Visual C++ 1.0. Research showed that While 70% of developers wanted to move to C++, only 15% were actually using it because of the difficulty in learning and using the language. Furthermore, developers didn’t want to learn an entirely new API or throw away their existing source code. Thus Visual C++ was created to provide the shortest path to C++ programs for Windows.

To ease migration to C++, Microsoft introduced the innovative wizard technology along with a new, more powerful version of MFC. MFC version 2.0 included and application architecture and features that further simplified application development, while providing full backward compatibility with version 1.0. Wizards were added to make it easier to exploit the full power of MFC. Wizards make it possible to generate fully featured applications for Windows without writing thousands of lines of tedious implementation code. An integrated editor, compiler, debugger and source browser make the edit-build-debug cycle as short as possible. An integrated visual resource editor makes it possible to develop user interfaces rapidly. In addition, Visual C++ 1.0 continued to focus on providing the smallest and fastest executables of any commercially available compiler.

Because it combined industry-leading performance with breakthroughs in ease of use, Visual C++ 1.0 became the shortest path to developing C++ applications for Windows.

Microsoft Foundation Classes

MFC 1.0 was first introduced in 1992 with Microsoft + 7.0. MFC 2.0 in Visual C++ 1.0 followed in February 1993. MFC 2.0 built on the Windows-specific foundation established in 1992 by adding sophisticated architectural elements such as document/view architecture, high-level application-specific features such as MDI support, tool bars, status bars, true device-independent output including print preview, and Object Linking and Embedding (OLE) support. In short, designing MFC to handle the standard interface chores and platform issues eliminated much of the tedious details facing C++ application developers. Most importantly, MFC 1.0 was upward-compatible with MFC 2.0. MFC 1.0 programs merely had to be recompiled to gain all of the new benefits of MFC 2.0. Investments in code were preserved without sacrificing innovation.

To ensure compatibility, we implemented MFC 1.0 and MFC 2.0 using a practical subset of C++ that exploited the language’s strengths without relying on unusual or compiler-specific features. As a result, the framework is portable between different vendors’ tools and compilers. MFC was written to solve real application problems of professional developers. It is tuned for both speed and size, to produce professional, industrial-strength C++ code for Windows with copious diagnostic support. MFC has been licensed to other leading C++ tools vendors including Blue Sky, Metaware, Symantic and WATCOM, affirming it as the premier C++ application framework for Windows.

Now, with version 2.5, MFC demonstrates its leadership by adding support for OLE version 2.0 and Open Database Connectivity (ODBC) while maintaining source-code compatibility with MFC 2.0. The MFC library has been available for the Win32 API since August 1993 and later versions will soon support other platforms, further demonstrating its portability.

A year after Visual C++ 1.0 was released, 81% of developers are using C++, with 30% already having completed several C++ projects. Visual C++ and MFC have helped make the move to C++ a reality.

Microsoft Visual C++ 1.0, 32-bit Edition: The Move to 32-Bits

Because developers needed tools to create 32-bit applications for Windows, in August 1993 Microsoft introduced Visual C++, 32-bit edition. This was the first integrated 32-bit development environment for professional C++ programmers for Windows that was hosted on the Windows NT operating system and that targeted both Windows (via the Win32s API) and Windows NT (via Win32). To ease developers’ learning curves, this product has the same tool set and class library as Visual C++ 1.0, but on 32 bits. It is the safest investment in C++ development tools because it provides an easy migration path from previous 16-bit Microsoft C++ products. MFC applications need only be recompiled to become fully functional 32-bit Windows-based applications. Because developers can write applications from a single source-code base that will run on Windows 3.1 and Windows NT, the 32-bit edition increases their productivity and allows them to take advantage of the performance benefits of 32-bit programming on both platforms.

Windows NT is the host for the 32-bit compiler because it is the most robust development platform choice. In addition, the true 32-bit platform enables the development of powerful 32-bit applications. We exploited its pre-emptive multitasking and multithreading capabilities to enable seamless background compilation and simultaneous multiple project builds. To aid debugging we added in the 32-bit Edition a memory Window on the current contents, support for structured exception-handling to help in locating errors, and support for threads, allowing developers to analyse and view window messages, relationships between windows, processes and threads as well as their details. Books Online technology revolutionised the presentation and usefulness of product documentation.

New optimisations for the I486 and Pentium processors helped ensure the smallest and fastest 32-bit executables. Visual C++, 32-bit Edition is proven technology: Microsoft used it to build Windows NT itself.

Visual C++ 1.5: The Move to OLE 2.0

In April 1993, Microsoft released OLE 2.0 – a breakthrough for component-based software development. OLE 2.0 provides a standard means of defining what an object is and how objects can interact. With OLE 2.0, developers from different companies can write objects that interact with one another without relying on the specifics of how those objects work. With OLE 2.0 developers can use entire applications as components, which makes application integration and combining information from multiple applications easier. Hundreds of companies have announced support for OLE 2.0, and corporations and independent software vendors (ISVS) are already using it to develop sophisticated applications for their end users.

Visual C++ 1.5 Makes OLE 2.0 Easy

Microsoft research shows that although more than 75% of developers would like to develop applications for OLE 2.0, less than 10% of them had started development before Visual C++ 1.5 was available. This was because native OLE 2.0 development can be difficult. However, Visual C++ 1.5 and MFC 2.5 make OLE 2.0 development easy. Using Appwizard, developers can create an OLE 2.0 client, server or container (even with OLE Automation) in seconds. Because AppWizard creates default code to deal with all OLE messages and requests, developers need only write code for the functionality that they want to support, thus significantly reducing the amount of time it takes to get started with OLE 2.0 applications.

AppWizard, C1assWizard and MFC 2.5 support full OLE 2.0 functionality, including toolbar and menu negotiation, visual editing, drag and drop, in-place activation, all structure and storage mechanisms, incremental read/write, component object model, and synchronous function completion. More than 19,000 lines of C++ code are provided in the MFC 2.5 Library to support OLE 2.0 development - code that developers don’t have to write.

Enabling Database Development

Incorporating support for database access in Windows-based applications can be difficult, Yet it is increasingly important. MFC makes it easy. ODBC classes and wizards allow full ODBC support for accessing local or remote databases to be built into Windows-based applications with just a mouse click. ODBC drivers are available today for a diverse set of database formats and implementations.

Plans of Leading Edge Developers for Windows

In order to better understand developers’ needs for the future, we surveyed more than 5,000 developers who attended the Win32 Professional Developer’s Conference in December 1993. We asked developers specifically what their plans were for 1994. The key results are shown in figure 1:

More than 80% are using MFC
More than 50% are targeting Win32-based applications
More than 50% are using Win32 as a host platform
More than 20% are targeting Win32-based RISC and Macintosh platforms
More than 60% are targeting OLE 2.0 More than 90% are using high-performance hardware (Intel 486 20MB RAM, CD-ROM)

Figure 1 - developer plans for 1994

New Issues for Developers in 1994

The survey indicated a very strong interest in the development community in targeting Win32 and OLE 2.0-based applications using MFC. Developers also want the flexibility to target other software and hardware platforms as they become more popular. They would like to do this through a single source-code base that is developed using a single tools set and class library. Finally, developers have the necessary hardware to host a Win32-based platform such as Windows NT and exploit the advanced capabilities that Windows NT provides.

Key Challenges for Visual C++ Tools

From the perspective of development tools, these goals presented us with four challenges:

  1. Provide tools that developers can use to create leading-edge applications for Windows that exploit the latest systems features, such as OLE 2.0, while enabling them to use their code investment in the future.

  2. Provide a clear and easy migration path to the 32-bit future of Windows through guaranteed upward compatibility.

  3. Provide a consistent tool set and class library that enable developers to easily target multiple platforms through a single code base.

  4. Provide tools that allow developers to exploit advances in host operating system platforms to increase productivity. For example, support background builds on a multitasking operating system such as Windows NT.

Microsoft’s Answer: Visual C++ Everywhere

The Visual C++ 2.0 family of products provides a consistent tool set and class library (MFC) that enables the development of Win32-based applications that target a wide range of platforms including Windows, Windows NT (Inte1- and RISC-based), Microsoft Windows “Chicago” (the next major release of Microsoft Windows), and the Macintosh. The Visual C++ 2.0 family utilises Microsoft’s systems strategy to provide the Win32 API along with key systems features such as OLE 2.0 and ODBC on all these platforms. Developers need only learn one tool set and API (MFC and Win32) to develop and support Win32-based applications that are portable and compatible across a range of leading platforms. Developers will be able to continue maintaining their 16-bit applications for Windows using Visual C++ 1.5. In addition, we will work with developers licensed to provide the Windows API on Unix platforms to make sure that developers can easily port their MFC applications using these platforms as well.

The Visual C++ 2.0 Family

The Visual C++ 2.0 family consists of the following products:

Visual C++ 2.0 Intel Edition.

This product hosts on a Win32- and Intel-based platforms (Windows NT or Windows “Chicago”) and enables developers to target Win32- and Intel-based applications that run on Windows (through Win32s), Windows NT, and Windows “Chicago”.

Visual C++ 2.0 RISC Editions.

These products host on a Win32- and RISC-based platform and target the same platform. The tool set is identical to the Intel-based tool set described above. The first version will be available for the MIPS platform followed by the Digital Alpha AXP and other RISC platforms supported by Windows NT.

Visual C++ 2.0, Cross-development edition for Macintosh.

This product is an add-on to the Visual C++ 2.0, Intel Edition and enables developers to target the Macintosh through a core Win32 code base. When this product is installed on top of the Visual C++ 2.0, Intel Edition, developers will gain new options to target the Maointosh. All development, compilation and linking are performed on the Windows NT-based machine. Debugging is performed across a network or serial connection to a Macintosh using the integrated debugger in the Visual C++ development environment.

The table in figure 2 illustrates the Visual C++ 2.0 product family:

Figure 2

Visual C++ 2.0: Continue the Innovation

In addition to the multiplatform support, Visual C++ will continue to provide the shortest path to developing applications that exploit the full power of the Windows family. Visual C++ 2.0 continues the leadership established by Visual C++ 1.5 by making it easy to develop 32-bit OLE 2.0 and ODBC applications through innovative wizards technology and a 32-bit compatible version of MFC. In addition, all versions of Visual C++ 2.0 exploit the power of Windows NT as the host development environment.

Enhanced Productivity

Visual C++ 2.0 provides a completely redesigned and integrated environment (IDE) that makes application development even easier than with previous versions of Visual C++. Everything is truly integrated, so there is no longer a separate App Studio application for resource editing, for example. The IDE includes all the latest innovations found in the latest Microsoft applications such as customisable toolbars and dockable windows.

Powerful project-management capabilities make it possible to manage complex development projects. Developers will also gain a dramatic boost in productivity through a new incremental linker that is aimed at producing 10-second links so developers can get from edit to EXE very quickly. The Browser can now be updated on demand rather than on every build, and it supports navigation of both definitions and references. Finally, C++ templates and exception handling have been added to the C++ compiler, enabling developers to benefit from the latest C++ language features.

Top-notch Performance

We have continued our leadership in C-based optimisations to turn our focus on new C++ optimisation. Our goal with the new optimisation technology, called Opt++, is to eliminate most, if not all, of the additional overhead that comes with using C++ rather than C. This technology along with highly tuned versions of MFC will enable developers to deliver applications built using C+ and MFC that have very little performance overhead compared to that of comparable programs built using C and the SDK.

Maximum Compatibility and Portability

Visual C++ 2.0 once again demonstrates our commitment to preserving developers’ investments in MFC. Visual C++ does this in a number of ways:

Version to version. MFC 3.0 is completely upward compatible with previous versions of MFC. new features provided with MFC 3.0 can easily be incorporated with little additional work.

16- to 32-bit conversion. 16-bit Windows-based applications written using MFC 2.5 included in Visual C++ 1.5 need only be recompiled with MFC 3.0 to convert them to 32-bit applications.

Intel to RISC. Applications written to MFC 3.0 are 100% source-code compatible across all Win32 platforms. They only need to be recompiled with the processor-specific Visual C++ compilers to produce executable files for different target platforms.

Win32 to Macintosh applications. As above, most MFG 3.0 applications can simply be recompiled with the Visual C++ 68K cross-compiler to produce executable files for the Macintosh. Applications written directly to the Win32 API can achieve 80% or greater compatibility, depending on the APIs used by the application.

Visual C++ Portability: RISCbased Multiplatform Editions

RISC editions of Visual C++ are identical to the Intel-based Visual C++ product. They also exploit the fact that Windows NT is the same on all hardware platforms.

This means that developers who use Visual C++ can use the same tools, regardless of which platform they are targeting. Also, features of the Visual C+ language - for example, C++ templates or exception handling - are implemented in the same manner on all platforms.

The same APIs, Win32 and MFC, are implemented identically across all supported platforms. A developer’s knowledge and code base can be used across all RISC platforms.

Multiplatform Architecture

To provide true targeting for Windows NT, 21 development system must support all Windows NT-compatible hardware platforms.

Microsoft is working closely with all licensees of Windows NT and is already shipping versions of the Microsoft C/C++ development tools for MIPS and Alpha AXP through the Win-32 SDK program.

Microsoft has licensed the compiler to several licensees of Windows NT and is actively integrating the compiler with each chip makers’ back-end optimising code generators.

Visual C++ 2.0 has also been designed to be completely portable across various Win32-based hardware platforms. Microsoft is working with licensees of Windows NT to port the entire Visual C++ development environment, including MFC, to all Windows NT-compatible hardware platforms.

The result is a compatible language implementation, integrated tool set, system API and C++ application framework across the entire family of Windows-compatible hardware. Developers will be able to use their existing source code, makefiles and development experience with Visual C++. They will benefit from the ease of use of the Visual G++ development system and from the high performance of the chip makers’ optimised native-code generators. The application architecture is depicted in figure 3.

Figure 3 - The application architecture

Visual C++ Portability: Macintosh Cross-development Edition

The cross-development tool set is an add-on to the Intel-based Visual C++ 2.0 development environment tailored for targeting the 68K-based family of Macintosh computers, and in the future, Power Macintosh versions of the same tools.

The product provides all the tools necessary for developing and debugging native applications for the Macintosh. These include an optimising C/C++ cross-compiler, linker, resource compiler, remote debugger and profiler. The tool set also includes a Macintosh version of MFC 3.0 and a Win32 portability library. These tools are all integrated into the Visual C++ 2.0 development environment.

The architecture of Macintosh applications generated by Visual C++ is shown in figure 4.

Figure 4 - Macintosh application architecture

The application source code can be Written in C or C++ and can be from a single source-code base that supports both Windows and the Macintosh. The Win32 portability libraries for the Macintosh simplify the porting of an application written to the Win32 API and/or to the Macintosh Foundation Class Library. These libraries generate appropriate Macintosh System 7 instructions from calls to the Win32 API. As depicted in the figure, developers can also program directly to the System 7 API to take advantage of platform-specific features. The resulting application, however, incorporates the native look and feel of a Macintosh application. Rigorous performance-tuning of the Win32 portability library ensures there will be very little performance penalty for the ported application. In fact, Microsoft uses this technology for its Macintosh application developments, such as Excel and FoxPro for the Macintosh.

OLE Custom Controls

Microsoft recently announced the OLE custom control architecture, which merges the popular Microsoft Visual Basic custom control architecture with the open, standard architecture of OLE. OLE custom controls make component-based development a reality by allowing developers to easily utilise existing bodies of functional code encapsulated as OLE controls. An OLE control is a custom control, implemented as an OLE 2.0 compound document object with visual editing support. An OLE control has additional capabilities beyond those of ordinary OLE objects, such as the ability to fire events. OLE controls will be supported in the future by all Microsoft development tools, including applications through Visual Basic, Applications edition.

Most OLE 2.0 objects require a substantial amount of implementation effort. Fortunately, an OLE Control DeveIoper’s Kit (CDK) - along with Visual C++ - provides most of the required implementation, so developers only have to fill in details that are specific to the OLE control. The CDK includes both 16- and 32-bit MFC extensions to support controls, a Controlwizard for creating an initial custom control project, C1assWizard extensions, a Test Container to verify the OLE control, full online documentation, and sample code.

Microsoft Visual C++ and the OLE CDK make component-based software development a reality.

Rollout Schedule

Visual C++ 2.0 for Intel and MIPS and the cross-development system for the Macintosh 68K are scheduled to be made available in the first half of 1994. A future version of this tool set will target other Windows NT- and RISC-based platforms and the Power Macintosh platform. The OLE CDK will be available in the same time frame as Visual C++ 2.0 for Intel.

The Visual C++ development environment and the Microsoft Foundation Class Library will continue to evolve to support Microsoft Windows operating systems in the years ahead.

Microsoft

Overload Journal #5 - Sep 1994 + Programming Topics