Introducing the Windows CE Embedded Toolkit for Visual C++ 5.0

David Pellerin

September 1997

Abstract

The Microsoft® Visual C++® development system has been established as the premier development tool for advanced desktop Windows®-based applications. With the introduction of the Microsoft Windows CE Embedded Toolkit for Visual C++ 5.0, Visual C++ has been extended to provide the same level of features and support to developers of embedded software and complete embedded systems.

This article will focus on the benefits of choosing Visual C++ and the Embedded Toolkit for embedded application development, and will help to answer the following questions:

Introduction

The Windows CE Embedded Toolkit for Visual C++ 5.0 (the Embedded Toolkit) is an add-on product for Microsoft Visual C++ version 5.0. The product is intended for both embedded system designers (those who specify and design complete embedded systems, including hardware), and embedded software programmers.

The Embedded Toolkit gives embedded system designers and embedded software programmers access to all the power of an integrated development environment (IDE), as well as access to the tools needed to custom configure Windows CE for their particular embedded-system needs. The Embedded Toolkit has been designed to meet the needs of embedded product developers targeting Microsoft Windows CE platforms.

Why use an add-on toolkit for embedded development? Embedded software programmers (and designers of complete embedded systems, including hardware) have needs that differ from those of more traditional Windows software programmers. For example, embedded systems often have extreme memory and other hardware resource constraints. The Embedded Toolkit includes information on how to make the most of limited hardware resources and—for those who are developing a custom hardware platform—provides the tools necessary to customize a version of Windows CE appropriate for the target hardware and application.

Because of the dramatic differences between embedded system design and more traditional Windows programming, the Embedded Toolkit has been oriented toward the specific needs of embedded system designers.

What Is the Embedded Toolkit?

The Windows CE Embedded Toolkit for Visual C++ 5.0 adds new embedded programming tools and capabilities, and new online information resources, to Microsoft Visual C++ version 5.0. These new capabilities include the ability to custom tailor the Windows CE operating system for the unique requirements of a new hardware platform, and to build complete, ROM-able versions of both the operating system and the application software.

One of the primary goals of the Embedded Toolkit is to clearly demonstrate how to customize and use Windows CE for a broad range of resource-constrained embedded applications. To this end, the Embedded Toolkit focuses on the following areas:

What Does the Embedded Toolkit Add to Standard Visual C++?

Visual C++ is a software development tool that has been used to develop many thousands of successful desktop applications for Windows. Visual C++ provides all the tools needed to create professional applications that are feature rich, robust, and testable.

Windows CE Embedded Toolkit for Visual C++ 5.0 provides additional capabilities for embedded software developers, over and above those features provided in Visual C++. These added capabilities include:

The inclusion of Win32 for Windows CE in the Embedded Toolkit is important; one of the primary reasons that Microsoft Visual C++ has become so popular for desktop application development is the power of the Win32 API.

The Win32 API is a common and consistent set of functions, procedures, structures and other interfaces for accessing the features of all Microsoft 32-bit Windows operating systems, including Windows CE.

In addition to cross compilers, debugging tools, and online documentation, the Embedded Toolkit provides the tools necessary for embedded systems designers to customize Windows CE for the unique needs of a given hardware platforms. System designers who are creating new hardware platforms can make use of the Embedded Toolkit to create customized versions of Windows CE that include only those operating-system components appropriate for their new hardware.

How Does the Embedded Toolkit Differ from Other Embedded Development Alternatives?

The Embedded Toolkit, and the underlying Windows CE operating system, have been designed specifically for today's powerful, 32-bit embedded processors. The debugging aids, design examples and operating-system build tools are all designed with the needs of embedded system designers in mind. Unlike other embedded development environments, the Embedded Toolkit has at its core an operating system and programming interface that are widely understood; there are hundreds of thousands of active Win32 programmers; and a seemingly limitless supply of information resources from which to draw.

Perhaps most importantly, Windows CE is backed up by Microsoft, as well as third-party system integrators. System integrators have specific expertise in embedded Windows CE applications, from device-driver development to the complete design of an embedded system, including hardware selection and design. This combination of direct and third-party support ensures that you can obtain the support and assistance you need, whether you are creating a fully customized embedded product or making use of pre-existing hardware.

Getting Started with the Embedded Toolkit

The Windows CE operating system has a rich set of features that are available through Visual C++ and the Embedded Toolkit. Embedded software programmers have access to these features via the world's most widely used programming interface (the Win32 API). At the same time, Windows CE has been designed with a high degree of modularity, giving embedded system designers the freedom to create a version of Windows CE that is customized and optimized for their unique hardware platform and application. For software developers, this means a simpler, more widely understood API, and more robust development tools. For embedded system designers, it means an operating system better optimized for modern, 32-bit embedded systems.

To use the Windows CE Embedded Toolkit for Visual C++ 5.0, you will need the following:

The Embedded Toolkit contains all of the cross compilers, assemblers, remote debugging tools, operating-system loaders, sample device drivers and application code, and other components you need to create embedded applications, and to custom-configure Windows CE for your application requirements.

To test and debug your application on actual hardware, you will also need one of the following:

If you choose to develop using a PC as your initial target (typically during the prototype phase), you can make use of a Windows CE operating system binary version supplied with the Embedded Toolkit. This Windows CE operating-system version supports the use of a PC-based hardware platform for prototype development and debugging.

Customizing Windows CE for Your Hardware

If you are creating a fully customized product, including the hardware, your first step will be to determine the hardware and application requirements and build a customized version of Windows CE that meets those requirements. When developing a new hardware platform and its supporting input/output (I/O) devices, you will be making decisions and tradeoffs at different levels in the design. For example, unless you are relying exclusively on common off-the-shelf hardware, you will almost certainly need to write custom device drivers to support one or more peripheral devices. You may also need to configure Windows CE to include the necessary device handling components, and to customize the HAL of Windows CE for your hardware.

At the application level, you will need to write interface code that meets the requirements of the devices in your system. The Windows CE DDK provides the information and examples you need to create Win32-capable device drivers.

To create a customized version of Windows CE that meets the unique requirements of your hardware platform, you must

As you can see, there are many steps required to create and implement a customized version of Windows CE. Fortunately, the Embedded Toolkit provides you with a rich set of tools intended to simplify this process, and allow you to focus on implementing and debugging your embedded application. The Embedded Toolkit also includes sample operating-system builds, so you can better understand the steps required.

Creating the Application Software

You have many programming options to choose from when writing application software for the Windows CE embedded operating system. The most common (and powerful) method of development is to use Visual C++ in conjunction with the Visual C++ for Windows CE add-on and the Win32 for Windows CE API, which are included with the Embedded Toolkit.

The Win32 programming model is a well-documented method of programming that is consistent across the entire 32-bit Windows family. Programming for the Windows CE operating system using Win32 is similar to programming for other Win32 platforms; this means that developers targeting Windows CE are able to make use of the vast quantity of Win32 programming resources, third-party tools, and outside expertise available when developing new applications.

Another important programming interface available to Win32 and C++ developers is the Microsoft Foundation Class Library (MFC). MFC provides higher-level encapsulations for much (but not all) of the Win32 API. In general, MFC supplies C++ classes that represent important Windows–user-interface objects such as windows, dialog boxes, brushes, pens, and fonts. MFC also provides classes that are appropriate for embedded applications having little or no user interface requirements. MFC class member functions make calls to the Win32 API functions, and can dramatically simplify the design of a complex application.

As a Win32 programmer, you are free to choose whether to program using C or C++ and the Win32 API, or using C++ and MFC. Visual C++ supports both methods of design (or a combination) for all Win32 target operating systems including Windows CE.

Debugging Your Embedded Application

The Embedded Toolkit provides a number of tools to aid you when debugging your design. For example, the Windows CE emulator, which is included with Visual C++ for Windows CE, allows you to execute many types of Windows CE–based applications on your development machine (typically a Microsoft Windows NT®–based workstation computer) before attempting to execute it on your target hardware platform. The emulator is intended to emulate the operation of a Handheld PC (H/PC) but can be used to execute and debug application software intended for other Windows CE hardware platforms as well.

For debugging of applications running on actual hardware, the Embedded Toolkit also provides features for remote control and debugging. The Windows CE debugger (Windbg.exe) allows you to debug user-level code in the Windows CE kernel itself, using the parallel port on your development system to communicate with the Windows CE operating system kernel.

In addition to debugging features unique to embedded systems programming and Windows CE, you have access to a variety of debugging aids provided with Visual C++. These include SPY, Heapwalker, and other utilities familiar to Visual C++ users.

Summary

The Windows CE Embedded Toolkit for Visual C++ 5.0 provides embedded system designers and embedded software programmers with a powerful set of tools for embedded system development. The modular architecture and robust programming interfaces provided with Windows CE can dramatically simplify the creation of advanced embedded products.

The Embedded Toolkit encapsulates a powerful set of embedded system design tools in a single integrated solution. The Embedded Toolkit has been designed to meet the needs of embedded product developers today, and in the future.

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date publication. This document is for informational purposes only.

MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.