When you port code between platforms, remember that the hardware configuration of most Windows CE-based platforms differs from that of a desktop computer. In some cases, a Windows CE-based platform might not be recognizable as a computer, though the functionality might be typical for a desktop computer. In addition, a Windows CE-based device may have hardware that has no counterpart on a conventional desktop computer, such as a Global Positioning System (GPS) chip. The most important hardware considerations for Windows CE-based devices are memory, power, user-interaction devices, and the broad range of CPU and communications options. Just recompiling your code with the appropriate Windows CE header files is not sufficient. You must examine the code to be ported while keeping in mind memory, power use, and user input devices.
Windows CE is designed to run on devices that have much less available memory than desktop computers. They may have no disk drive or other mass-storage device, or may support PC Cards that can be used as an alternative to a disk. Even if mass storage is available on the device, RAM is used to store data and applications and to execute programs. In general, you should limit the RAM requirements of your application and associated data and resources.
Windows CE supports functions, structures, and messages that are not supported in Win32, but that may be useful to you when you port code across platforms. Many of these elements will help you manage limited resources. For example, if memory resources become tight during operation, Windows CE has a procedure to reduce memory use and restore available memory to acceptable levels. The key to this procedure is the WM_HIBERNATE message, which notifies applications of low memory. Because this message is not part of Win32, you must implement a handler for it and cooperate when the message is received.
A Windows CE-based platform that operates on batteries has a limited energy supply. If you develop an application for such a platform and must port it, follow these guidelines to make the most of limited power resources:
Applications for desktop computers assume that the user will get information from a relatively large screen and will communicate with the computer using a keyboard and a pointing device. Windows CE-based platforms may use very different hardware than this. The screen is generally smaller or absent, and the platform may have no keyboard or pointing device at all. On the other hand, a Windows CE-based platform may provide user-interaction hardware that is not commonly found on a desktop computer, such as a microphone for speech recognition or a stylus and screen for handwriting recognition. For more information about user-interface considerations, see User Interface Considerations.
In addition, Windows CE offers a variety of communications hardware options, including infrared (IrDA) and radio transceivers, that require special consideration. Windows CE supports most standard communication methods, including serial communication, TCP/IP, and IrDA stacks, through WinSockIt. It also supports output by means of modems, infrared transceivers, and local-area networks. For more information about different communications hardware and communications programming, see Using Communications.