Home > Store

Windows CE Technology Tutorial, The: Windows Powered Solutions for the Developer

Register your product to gain access to bonus material or receive a coupon.

Windows CE Technology Tutorial, The: Windows Powered Solutions for the Developer

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2000
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-61642-4
  • ISBN-13: 978-0-201-61642-2

This is the first complete Windows developer's guide to leveraging the power of Windows CE 3.0 and future "Windows-powered" devices. Leading Windows CE developer Chris Muench teaches Windows developers all they need to know to build CE 3.0 applications fast. Start by setting up and mastering the Windows CE 3.0 "Rapier" development environment; then, walk step-by-step through building a robust CE application that utilizes COM components, integrates with Windows 2000 and other Windows desktops, and even provides Internet connectivity. Along the way, developers will learn how to design CE user interfaces, support printing, storage, and remote access; synchronize with desktops via the latest version of ActiveSync; incorporate graphics and audio; even integrate with Pocket Outlook.

Downloads

CD Contents

Download the CD Contents for this title.

Extras

Web Resources

Click below for Web Resources related to this title:
Author's Web Site

Sample Content

Table of Contents



Preface.


Acknowledgments.


Foreword.

I. READY…SET…GO!

1. Why Windows CE?

What Is Windows CE?

Windows CE versus Embedded Windows NT.

2. Preparing Your PC for Windows CE.

Choosing the Right PC.

Get at Least a Pentium II or K6-2 with 300MHz.

Use Windows 2000 Professional or Windows 2000 Server.

Get a Lot of RAM.

Use the New Dual-or Multi-Monitor Support.

Get a Big Hard Disk.

Use a Network Interface Card (NIC).

Use DVD-ROM Instead of CD-ROM.

Choosing the Right Windows CE Device.

Summary.

3. Installing Your PC.

Installing the Operating System.

Installing the Development Tools.

Office 2000.

Visual Studio 98.

The eMbedded Visual Tools 3.0.

The Windows CE Platform SDKs.

ActiveSync 3.1.

Setting Up Your Windows CE Device to Connect to the Workstation.

Create a Direct Dial-Up Connection Using 115K Baud.

Setting the Default Connection for the PC-Link.

Test Your Connection to the PC.

Optional Steps: Using a LAN Card to Connect to Your PC.

4. The Windows CE Development Tools.

Windows CE Tools.

Remote File Viewer.

Remote Heap Walker.

Remote Process Viewer.

Remote Registry Editor.

Remote Spy++.

Remote Zoomin.

The Control Manager.

eMbedded Visual C++ versus eMbedded Visual Basic.

The eMbedded Visual Basic Environment.

Creating, Downloading, and Debugging a Small eVB Application.

The eMbedded Visual C++ Environment.

Creating, Downloading, and Debugging a Small C++ Application.

Using the Windows CE Platform Manager.

Choosing the Right Framework for Your Task.

Basic Windows CE Development Tips.

Compile-Time Version Checking.

Compile-Time Platform Detecting.

Runtime Version Checking.

Accessing Debug Messages in ActiveX Controls.

Debugging ActiveX Controls.

5. The Thread-Example Pocket-CD-Manager.

The Pocket-CD-Manager Feature List.

Creating the Framework of Your Application.

Differences between the Desktop and Windows CE Versions.

stdafx.h.

PCDM.CPP.

Mainfrm.cpp.

PCDMoc.cpp.

PCDMView.cpp.

Resources.

Differences in Project Settings.

The User Interface of the Pocket-CD-Manager.

''File''.
''Help''.

Creating a Prototype of PCDM.

Creating the Desktop Version of the Prototype.

Porting the Desktop Prototype to Windows CE.

Preparing the DeluxeCD Database.

Converting the Desktop eVB Project to an eVB Project.

Migrating Forms and Code.

Migrating ADO Desktop to ADO for Windows CE.

Summary.

6. COM for Windows CE.

A Short Introduction to COM.

How Does COM Work?

Versioning.

Early Binding No Longer Necessary.

Communicating EXE to EXE.

Making Remote Communication Seamless.

COM Activation Methods.

In-Place Activation.

ActiveX Controls.

Inproc: In-Process Activation.

EXE to EXE.

MTS or DLLHOST.EXE.

DCOM.

COM+ Services.

Creating a Small COM Server.

Creating a COM Server for Windows CE.

Generating the Desktop-Equivalent COM Server.

Calling the COM Server in C++.

Using #import.

Calling the COM Server in Visual Basic.

Creating an ActiveX Control.

Creating an ActiveX Control for Windows CE.

Generating the Desktop Equivalent.

Using the Control in eMbedded Visual C++.

Using the Control in eMbedded Visual Basic.

Creating the Wrapper Controls for the PCDM.

DCOM: Distributed COM.

deviceCOM: The Industrial Version of DCOM.

Installation of deviceCOM.

Starting DCServer as a COM Surrogate.

A Small deviceCOM Example.

Other Features of deviceCOM.

Summary.

II. WINDOWS CE IN DETAIL.

7. The Windows CE User Interface.

The Command Bar.

Adding a Command Bar to an Application.

PCDMUI: Including the Command Bar.

Testing the Control in eMbedded Visual Basic.

Calling the Control from the PCDM Application.

Summary.

The Command-Band.

Adding the Command-Band to an Application.

Updating the PCDMCommander Class.

Testing the New PCDMCommander Class in eMbedded Visual Basic.

Using the PCDMCommander Class in the PCDM Application.

Summary.

Special Palm-size PC Considerations.

Small Example Showing the Application Menu Bar.

Updating Your PCDMCommander Class.

Testing the New Class in eMbedded Visual Basic for Palm-size PC 2.0.

Verifying Your PCDM Application.

The List View Control.

Including the List View Control in an Application.

Adding the List View Control to PCDMUI.DLL.

Testing the New CPCDMList Class in Visual Basic.

Using the New CPCDMList Class in the PCDM Application.

Summary.

Other Supported Common Controls.

Common Controls That Are Not Supported.

Printing in Windows CE.

The Hardware Buttons on Palm-size PCs.

The Action and Escape Keys.

The Application Launch Keys.

The Soft Input Panel.

A Simple Application Showing the SIP.

ShowSIP() for PCDMDLL.DLL.

Testing the New PCDMUI in Visual Basic.

Ink Control.

Creating a Small Ink Control Application.

Other Ink Control Functions.

8. Storage.

The Windows CE Registry.

Adding CPCDMAccessReg to the PCDMDLL.DLL.

Testing the New CPCDMAccessReg in eMbedded Visual Basic.

The File System.

No Drive Letters.

The Name ''Storage Card'' Can Be Localized.

''My Documents'' on a Palm-size PC.

The Object Store.

A Simple API Application Accessing the Object Store.

A Simple MFC Application Accessing the Object Store.

Adding Object Store Access to the PCDMDLL.DLL.

Testing the New Class in eMbedded Visual Basic.

Adding the PCDMAccessDB Class to the PCDM Application.

ADO for Windows CE.

A Simple Application Using ADO.

Adding ADO to the PCDMAccessDB Class.

Retesting ADO Changes in eMbedded Visual Basic.

Pocket-Access Files.

Copying an Access 2000 Database to the Emulation.

Synchronizing Pocket-Access with Access 2000 Databases.

Updating the PCDM to Use the New Database.

9. Remote and Connectivity.

Using RAS as TCP/IP Provider.

Install the Communication Cable between Two PCs.

Setting the Baud Rate of the Communication Cable to 115K.

Set Up Windows 2000 Incoming Connections.

Windows 2000 Server in a Domain Environment.

Remote API.

A Small RAPI Example.

Converting ObjectStoreIt to a Desktop Application.

Updating Your PCDM Application with RAPI.

Testing the Class in Visual Basic for the Desktop.

ActiveSync: Keep in Sync with Your Data.

The Concept of ActiveSync.

Creating an ActiveSync Service Provider for the PCDM.

Some Debugging Tips.

Summary.

Distributed COM.

Winsock.

A Tiny Winsock Example.

The PCDM Application.

IrDA or Infrared: The Wireless Wire.

Adding IrDA Support to Your Winsock Example.

Adding IrDA Support to the PCDMDLL.

Test the New PCDMDLL in eMbedded Visual Basic.

Implementing @BHEADS = Send to...''/

Receive...''in the PCDM Application.

HTTP: Integration of the Internet.

Wininet: The Client Internet API.

A Small Wininet Example.

The Web Server Issue.

10. Graphics and Sounds.

Loading Bitmaps.

Using LoadBitmap().

Using SHLoadDiBitmap().

Using Custom Code.

Adding a Picture Class to the PCDMUI.DLL.

Displaying Bitmaps Using GDI.

Updating OnDraw of the PCDMPicture Class.

Testing the PCDMPicture Class in eMbedded Visual Basic.

Updating the PCDM Application.

Playing Sounds Using the Windows CE API.

Adding a Sound to the PCDM Application.

DirectX on Windows CE.

11. Miscellaneous Topics.

Enhancements for Pocket PC Devices.

Window Size Must Be Calculated Differently.

Only Full-Screen Dialog Boxes.

A Tiny Example.

Summary.

Creating Help Files for Your Application.

Creating a Help File for the PCDM Application.

Calling the Help File from within the PCDM Application.

Creating a Control Panel Application.

Adding an Icon to the Taskbar.

Adding a Task-bar Icon to Your PCDM Application.

Installation for Windows CE.

Installation Targeting Windows CE.

The Installer Information File (.INF).

Creating the Installer File for Your PCDM Application.

Creating a CEF Installation for PCDM.

Writing a Custom SetupDLL.

CF-Card Instant-Installer for the Pocket PC.

Creating an Installation for the Desktop.

Rules to Make Your App Logo-Compliant.

Logo Requirements of All Target Platforms.

Special H/PC Logo Requirements.

Special Palm-size PC Requirements.

12. Conclusions and Visions.

A Word about Your PCDM Application.

What's Next?

How Small Will It Become?

The Dark Side of the New World.

What Can You Do to Take Part?

Where Is the Technology Now?

III. Appendices.

Appendix A. Frequently Asked Questions.
Appendix B. The PCDMUtils Class.
Appendix C. Glossary and Abbreviations.
Appendix D. Tips and Tricks for Unicode versus ANSI.
Index. 0201616424T04062001

Preface

Welcome to the World of Windows CE

Windows CE is probably the most underestimated technology Microsoft has ever produced. At present, Windows CE is most commonly used in palm-size and handheld PCs, but in fact it is capable of much more. The embedded environment Windows CE is targeting holds a nearly unlimited reservoir of opportunities for software developers and original equipment manufacturers.

Windows CE was written from scratch but is modeled after its bigger brother Windows. This book will help you to understand the differences between these two brothers and will guide you step by step through all the major technologies of Windows CE.

Back in 1996, when Windows CE was still in diapers, I was already working on several hardware and software products using this program as the base technology. At that time I was working as a technology ambassador for Siemens at Microsoft, which entailed dual responsibilities: to evangelize Windows CE at Siemens and to deliver feedback from Siemens to Microsoft. During my time at Microsoft I made friends in all departments of the Windows CE team. The Microsoft DRG (Developer Relations Group) made sure that I always had the latest Windows CE devices running the newest beta build of their next generation software. The Windows CE Marketing and the Tools Team provided me with the latest versions of SDKs (Software Development Kits) and compilers. Many of those technologies were still in beta when I wrote this book. By the end of 1998 I had collected so much information and knowledge about Windows CE that I thought it would make a useful book for others.

How Is this Book Different from Others?

The title tells you that this book is a technology tutorial. But what is a technology tutorial? A tutorial explains something by walking the reader step by step through an example. This book is a technology tutorial because it uses the tutorial method to walk you through all the essential technologies of Windows CE. Traditional technology books generally discuss a technology in a more theoretical way, for example, by explaining the Application Programmable Interface (API) calls and their parameters. However, during my years of experience as a developer, I found that even the worst example is better than the best theoretical explanation.

During the course of this book you will find innumerable tiny examples and step-by-step explanations showing you how to recreate each example from scratch. At first the explanations will be very detailed, but as you proceed through the book, you'll find that they come to focus more on the essentials.

In addition, this book emphasizes the importance of Windows 2000. This new operating system will quickly become essential for developers, industrial users, and end-customers in the business sector.

The book also stresses the importance of the Common Object Model (COM) approach for Windows CE. COM is the best way of preparing any application for the digital and "distributed-technology" age we will face in the near future--and which I will discuss more fully in Chapter 12.

The "Thread Example": A Real-Life Application

Another big feature of this book is the "thread example." The thread example is a Pocket-CD-Manager (PCDM) application. It allows you to synchronize a database of your CDs with the "Microsoft Deluxe CD Player" on your desktop and manage it with your Windows CE device. The PCDM will, with very few exceptions, explore all the technologies of Windows CE. This example, which gets its name because it weaves through the book like a red thread, is a real-life application that you will create from scratch. At the end of the book the application will be ready for deployment, including a redistributable setup.

How to Read this Book

This book is meant for developers who want to bring their desktop programming experience to Windows CE but have not yet worked on Windows CE. In other words, it is aimed at Win32 professionals who are Windows CE beginners.

To guide you through the technologies of Windows CE, the book contains 12 chapters, each focusing on one area of Windows CE. The order of the chapters is determined by the real-life thread example. As in any tutorial, you will create this real-life example from start to finish. The sample application is a Pocket-CD-Manager that will synchronize a CD library database on your Windows CE device with the library of the Deluxe CD Player on your Windows 2000 desktop. To be more specific, you will learn how to

  • Set up your development machine (Chapters 1-3)
  • Create the first steps of the application by choosing the framework, creating the application base structures, and designing a prototype in eMbedded Visual Basic (Chapters 4-5)
  • Create the framework for two components used in the sample application introducing COM on Windows CE (Chapter 6)
  • Include the UI elements like CommandBar, CommandBand, and ListView, among others (Chapter 7)
  • Add storage capacity to the application using Registry, ObjectStore, and Active Data Objects (ADO) (Chapter 8)
  • Add support for remote technologies like Remote Application Programmable Interface (RAPI), infrared communication, and ActiveSync (Chapter 9)
  • Create a fancy About Box using graphic APIs on Windows CE (Chapter 10)
  • Wrap up the application by adding advanced feature support for palm-size PCs, creating a setup to install the application on Windows CE and to distribute it using the Windows Installer Technology (MSI) (Chapter 11)

If you follow all the steps, you will end up with a fully functional Pocket-CD-Manager application.

One goal of this book is to keep the sample code as simple as possible. Therefore you will not check each and every error condition, and some code will look a bit "crude." For example, instead of using dynamically allocated and growing lists, the book will rely upon fixed-dimension arrays.

Besides the thread example, each chapter will also contain a tiny code snippet that shows the technology at work. This will allow you to jump to any chapter if you are just interested in a specific technology.

To summarize, the technology section of each chapter will have several sub-sections including all or parts of the following:

  • An introduction to the technology
  • A small code snippet giving you a quick glance at the technology
  • A sub-section wrapping the technology into a COM component
  • A small Visual Basic code snippet using the COM component of the previous sub-section
  • A sub-section adding the COM component to the main PCDM application
  • A summary highlighting the main caveats, gotchas, and remarkable facts of the technology

The book contains countless examples and sample code. To save space, I provide only the technology-specific code and not all the plumbing code that the eMbedded Visual C++ (eVC) wizards create. If you have to change any code, the new code will be printed in boldface. Most of the code is embedded in step-by-step procedures that explain exactly what you have to do to add the code to the example. Since many of those procedures will have repeated content (for example, adding a method to a COM component), they will become progressively simpler and less detailed as the book progresses.

// Code lines themselves are printed in fixed letter spaces.

The Companion CD

All source code printed in the book can also be found on the companion CD in the directory Sources. Chapter and section numbers structure this directory. An extra sub-directory contains the sources of the thread example. Inside this directory you will find sub-directories named PCDMUI, for the user interface component; PCDMDLL, containing the core technology component; and PCDM CE, the main thread-example application.

Other directories include tools, helpers, and some redistributables you can use to evaluate certain third-party technologies like DeviceCOM, InstallShield for CE, the Microsoft Installer SDK, and the latest ActiveSync. The source code on the CD was created using the latest Microsoft eMbedded Visual Tools. I removed all temporary eVC files but kept the executables and DLLs so that you can run the application without having to recompile them. If you open the source-code, you will find the book-specific code between two remark lines:

// **************************************

// *************************************

The thread-example code adds the step number after the chapter number to the remark tag. If you are familiar with Extended Markup Language (XML), you will recognize that we are using XML syntax to mark the code of the book. Using a Visual Basic macro, you could highlight the areas where the book has added code.

The Beginning at the End

The final chapter will give you some general ideas about where to go from here and what the digital future may bring. In case you do not know what to do with Windows CE, just read it, and you should come away with at least one idea that leads to a great digital-age product.

Now, without further ado, let's get started.



0201616424P04062001

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020