Visual Basic

Target Audience

The Windows CE operating system is specifically targeted at independent hardware vendors (IHVs) and original equipment manufacturers (OEMs). Windows NT and Windows 9x are available as software packages that can be installed on a computer; however, Windows CE is designed to reside in read-only memory (ROM). It is therefore not possible for a software developer to simply buy the operating system, install it, and write software for it. The uses of Windows CE are almost unlimited in scope in the OEM and IHV markets, although some types of applications will depend on enhancements being made to the operating system even as I write.

Consider a domestic electronic device that you have at home or in your office. Chances are that the product uses custom hardware and an operating system with the code written in either assembly language or C/C++. The manufacturers might design and build their own hardware or they might buy components upon which they build. Whichever method is used to build the product, more than likely the processor has been designed specifically for the task it performs. Any change to the product's features might well involve changes to the processor unit-in short, increasing the development time and costs.

Windows CE offers the ability for a manufacturer to buy a fully customizable operating system that is based on the Microsoft Win32 API. A large base of Win32 programmers already exists; therefore, the task of programming a Windows CE device becomes that much easier. Another benefit is the amount of training and support that is available. However, the real benefits can be better understood if you consider the additional functionality available as part of the operating system.

I mentioned that Windows CE offers the ability to build a device that can be programmed using the Win32 API and standard tools like Microsoft Visual C++. However, these capabilities by themselves probably would not be enough incentive to persuade the electronics industry to switch to Windows CE. Bear in mind that the operating system is licensed and the cost of the license fee depends on configuration and volume. OEMs are used to building their own hardware and maybe even writing their own operating systems. The real incentive for using Windows CE lies in the additional components, listed below:

  • Transmission Control Protocol/Internet Protocol (TCP/IP), Point-to-Point Protocol (PPP), and Telephony API (TAPI) components offer the ability to communicate using industry standard protocols. Using these communications components, the vendor can build support for the Internet and intranets in the same way that Windows programmers do. HTML support is also a feature of the operating system. Even for an OEM, the time and costs required to build these components from scratch would more than likely be prohibitive, because the development cost would price the device out of the market.
  • IrDA is the infrared port communications protocol. Again, using standard programming techniques, the vendor can support infrared communication of complex data. This will be a popular form of communication for devices that are in mobile locations. For example, a telephone device installed in a vehicle will need some means of receiving updates to its software or data. A typical scenario might be a user downloading his or her PC contacts file onto a handheld device, and then transmitting the data from the handheld device to the telephone using an infrared link. The telephone also serves as an example of how much potential this technology has. For example, it is feasible that a Windows CE telephone could update new software via a telephone call from the desktop-wow! (Not "Windows On Windows."<g>)
  • As most Windows CE machines don't have any disk storage available to them, the object store provides intrinsic data storage methods as part of the operating system. This is covered in more detail later in this chapter; however, the object store essentially provides database, Registry, and file system functionality. The object store is accessible via the Win32 API, so utilizing this functionality is purely a software task-the vendor does not need to build any additional hardware. I should mention at this point that the Windows CE database is not a relational database-it's an indexed sequential access method (ISAM) database, meaning it allows storage of a number of fields indexed on up to four keys. Any record might contain any data in its fields, and might contain any number of fields.

    Microsoft Visual Basic, Java, and Microsoft Foundation Class run times can be incorporated into the operating system by the device manufacturer. These components are available for purchase when you buy the Windows CE license. Devices built with these components have the added advantage that the components reside, and are executed, in ROM. This is a big bonus, because, for example, the Visual Basic run time is around 600 KB in size. A Visual Basic program would not require these components to be installed again, thereby leaving more memory for the application. Corporate buyers should make note of this point, because whether these run-time components are included in the operating system is purely the manufacturer's decision. If you will be developing applications requiring any of these run times, it might pay to invest in a device with the required components built in.

    COM objects are supported by Windows CE, although at present they can be created using only C++ and must be in-process DLLs. This means that for the time being it is not possible to build Distributed COM (DCOM) objects. It is important to remember that Windows CE is a fairly new technology. Although the Windows CE desktop systems are largely compatible with the Windows 9x/NT systems, the underlying code is totally new and is optimized for the Windows CE environment. This is one of the reasons why some of the tools available have limited functionality. However, Microsoft is listening carefully to its users, so you can expect these tools to become more powerful over time.

  • In addition to the language support, Microsoft Internet Explorer can also be an integral part of the operating system. This is an invaluable addition for Web-enabled devices. I would imagine that a vast number of Windows CE devices will be Web-enabled-WebTV is just one example. Again, imagine having to write your own Web functionality totally from scratch! The scope of devices using World Wide Web features is limited only to the imagination.

Now that I've described all the benefits, it is probably easier to comprehend just what Windows CE has to offer. Indeed, the amount of interest being shown by the electronics industry is proof of its potential. The potential market for Windows CE devices is enormous. Based on the history of the electronics industry over the last decade, it might be safe to assume that as the Windows CE operating system is enhanced over time, more diverse applications will be developed to solve problems we experience today. Some solutions might stretch the Windows CE architecture to its limits, performing tasks that we would not have believed possible. At the moment, Microsoft envisions that Windows CE will be best suited to the three main categories of product shown in Figure 5-1.

Microsoft has divided its support for the application of Windows CE into two areas: semi-targeted products and targeted products. Essentially, for semi-targeted products, Microsoft will work with OEMs and IHVs to produce custom components for a specific purpose (for example, writing device drivers). For targeted products, Microsoft will make enhancements to the operating system itself to support features required by certain types of application. One example of a targeted product is the HPC, where the operating system has built-in support for most of the features it requires.

Figure 5-1 The main Windows CE product categories and typical usage