One of the pieces of feedback we’ve been hearing a lot from the Windows
Embedded community is that you'd like a FAQ that answers the basic
questions posed to our newsgroups and submitted to our support
professionals. I'd like to submit the following as a draft of this FAQ and
invite any feedback to be directed towards edev...@microsoft.com.
Our goal is to make this a consistently updated technical document
available on our website.
Thanks!
Michael Fosmire
Community Program Manager, Windows Embedded
This posting is provided AS IS with no warranties, and confers no rights.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Windows Embedded Operating Systems FAQ
The information in this article applies to:
Microsoft Windows CE 3.0
Microsoft Windows CE.NET
Last updated August 29, 2002
Summary
This document answers some general questions about the Microsoft Windows CE
3.0 and Windows CE.NET operating systems. The frequently asked questions
are organized as follows:
1. General Windows CE (introductory) questions
2. Windows CE specific-topic questions
- Real-time
- Audio
- Multimedia
- Power Management
- Drivers
- Other
3. Windows CE Application Development questions
- eVB
- Database Programming
- General Windows CE Development
4. For more information.
We're interested in our feedback concerning these frequently asked
questions. Please forward any feedback to edev...@microsoft.com
General Windows CE Frequently Asked Questions
Note, for additional frequently asked questions and answers, please see the
following website:
http://www.microsoft.com/windows/embedded/ce.net/evaluation/faq/default.asp
Q. What is Windows CE?
A. Microsoft Windows CE is an open, scalable Windows platform for a broad
range of communications, entertainment and mobile-computing devices. The
standards-based Windows CE platform is an entirely new operating system
built from the ground up to make possible new categories of business and
consumer non-PC devices that can communicate with each other, share
information with Windows-based PCs, and connect to the Internet.
Q. Why did Microsoft develop Windows CE?
A. For the past few years, Microsoft has outlined its vision of
'Information At Your Fingertips,' in which the idea of a personal computer
on every desk and in every home evolved into one of computer-based devices
in a variety of business and consumer environments. The Windows CE
operating system is the result of a multiyear development effort to fulfill
that vision. With Windows CE, Microsoft is providing an open,
standards-based platform that will significantly lower the hurdles for
OEMs, hardware manufacturers, software developers, and, ultimately,
customers to adopt new non-PC technologies and solutions.
Q: What's the difference between PocketPC and Windows CE 3.0?
A: Windows CE is an operating system shipped as a set of building blocks.
PocketPC is a specific device built from these Windows CE building blocks.
The Windows CE 3.0 operating system running on PocketPC and PocketPC 2002
devices is not, therefore, equivalent to the Windows CE 3.0 operating
system running on other devices.
For more information and frequently asked questions concerning PocketPC,
please see the following website:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce30/html
/ppcfaq.asp
Q: What is Windows CE.NET?
A: Windows CE.NET is basically Windows CE 4.0. Platform Builder 4.0 is
the integrated development environment for building customized embedded
platforms based on Windows CE .NET.
To find out what's new with Windows CE 4.0 and 4.1, please see the
following website:
http://msdn.microsoft.com/library/en-us/wcemain4/htm/cmconWindowsCENewFeatur
es.asp
Q: What is this "Jameson" .NET update?
A: Jameson is a minor update to the recently released Windows CE .NET
technology that will deliver several additional technologies that customers
have asked to be delivered -- before the next major revision of the Windows
CE .NET product. The planned Jameson features include: IPv6 support,
Enhanced device management, Support for document viewers for popular file
types.
To find out what's new with Windows CE 4.1, please see the following
website:
http://www.microsoft.com/windows/Embedded/ce.NET/evaluation/whatsnew/cenet41
asp
Q: Who uses Windows CE?
A: For a current list of current Windows Embedded partners, please see
the
following website:
http://www.mswep.com/
Q: How can I get the Windows CE .NET SDK?
A: There are a couple of options:
1. The Windows CE .NET Emulation Edition download (free download)
http://msdn.microsoft.com/downloads/sample.asp?url=/msdn-files/027/001/699/m
sdncompositedoc.xml
2. The Windows Embedded Evaluation Kit (with a small shipping charge)
http://www.microsoft.com/windows/Embedded/ce.NET/evaluation/trial/evalkit.as
p
3. The Windows CE .NET product
http://www.microsoft.com/windows/embedded/ce.net/howtobuy/default.asp
Q: What is the Shared Source Initiative?
A: More information can be found at the following websites:
http://www.microsoft.com/windows/embedded/ce.NET/evaluation/sharedsource/
http://msdn.microsoft.com/chats/embedded/embedded_021402.asp
Q: Is the shared source the same across the Evaluation edition, the
Emulation edition and what's in the box?
A: Yes.
Windows CE specific-topic questions
Real-time
Q: Is Windows CE really hard real-time?
A: Real-time performance is not difficult to measure, but can be
difficult
to define. Based on the standards outlined by the Open, Modular,
Architecture Control (OMAC) user group Microsoft Windows CE .NET is a hard
real-time operating system.
For more information, please see the following:
Real Time with Windows Embedded
http://www.microsoft.com/windows/Embedded/perceptions/realtime.asp
Real-Time and Windows CE .NET
http://www.microsoft.com/windows/embedded/ce.net/evaluation/features/realtim
e.asp
For a Microsoft-external point of view concerning Siemens experiences in
gaining hard real time from Windows CE 3.0 (also applies to Windows CE
NET), please see the following:
http://msdn.microsoft.com/library/en-us/dnce30/html/realtimecapabilities.asp
Q: Is there a minimum value that the quantum can be set to?
A: There is no forced minimum, but you would not want it below 10ms
because
of the extra overhead required for thread switches.
Q: How can I check the priority for a running thread?
A: You can check thread priorities in the debug shell with the command "gi
thrd" or by using Platform Builder's threads window.
Q: Is there a way to set the default thread quantum for all threads?
A: The default thread quantum is set at 100ms in the OAL
(dwDefaultThreadQuantum). An OEM can set this variable to another value in
OEMInit().
Q: Where can I get further information about Windows CE .NET's real-time
capabilities?
A: Here are some additional resources that should be helpful:
Hard Real Time-Tips and Tricks and Some Cool New Features
http://www.microsoft.com/Windows/embedded/community/experto/sept2001/nframpt
on.asp
Online seminar - Windows CE Real-Time
http://www.microsoft.com/seminar/mmcfeed/MMCDisplayFeed.asp?Sort=length&Lang
=en&Product=103303&Product=103355&Audience=undefined&
Audio
Q: My audio driver worked fine on Windows CE 3.0 but it sounds terrible
under Windows CE .NET. How can I fix it?
A: Prior to Windows CE .NET, audio drivers often failed to properly
support
streaming since streaming was seldom tested or exercised. The Windows CE
NET software mixer, which allows multiple sounds to be played
simultaneously, always streams audio data to the driver in relatively small
buffers (2-4Kb).
The two most common reasons for incorrect streaming are a) oversized DMA
buffers, and b) failure to handle audio interrupts properly.
The fix for the first problem (oversized DMA buffers) is to reduce DMA
buffer size to 2k, or to use a registry override to increase the size of
the buffers being sent from the software mixer (Platform Builder
documentation explains how to do this - search for "SoftwareMixer"). The
latter approach is not recommended, though, since it increases audio
latency and degrades the user experience.
The actual fix for the second issue requires case-by-case debugging of the
driver to see what's going wrong.
Q: The Windows CE.NET docs talk about a new UAM driver model. Do I need to
rewrite my audio driver or can I re-use my existing driver?
A: You should be able to re-use your existing driver and should consider
switching to a UAM driver only if:
1. You want to support DirectSound on your platform AND your audio device
supports hardware-accelerated mixing, OR
2. You want to support the mixer API (mixerOpen, mixerGetLineInfo, etc.)
Q: Is there sample code for simple audio playback? How about streaming
audio playback?
A: Windows CE .NET ships with a very simple audio playback application
which shows how to play simple (and short) .wav files, but does not show
how to handle streaming playback (i.e. files larger than available RAM, or
audio coming in over the network).
The sample application is located, by default, in the
public\common\sdk\samples\audio\wavplay directory.
Q: Is there sample code for simple audio capture? How about streaming
audio
capture?
A: Windows CE .NET ships with a very simple audio capture application
which
shows how to record simple (and short) .wav files, but does not show how to
handle streaming capture (i.e. files larger than available RAM, or audio
being sent out over the network).
The sample application is located, by default, in the
public\common\sdk\samples\audio\wavrec directory.
Q: I'm writing an audio application for my PocketPC device. It works great
on my desktop and other Windows CE devices - even another PocketPC, but
fails on my device. What's wrong?
A: You may have a defective audio driver. Contact your PocketPC
manufacturer for more information and updates.
Multimedia
Q: Does the Windows CE .NET Media Player support MPEG-4 video streaming?
A: It depends on the encoder that was used for the file. Windows CE .NET
supports Microsoft MPEG-4 which is a legacy MPEG-4 implementation that was
used in the Microsoft Windows Media Encoder v6. Windows CE .NET also
supports the Microsoft MPEG-4 ISO v1 which is compliant with the MPEG-4 ISO
standard simple profile. Windows Media Video is also supported. Refer to
the Windows CE .NET documentation for the exact version information for
each of these decoders.
The general rule is that if you are using a Microsoft supported encoder,
the MPEG-4 video formats are most likely supported on Windows CE .NET. If
you are using a different encoder, the best bet is to encode the video
using the MPEG-4 simple profile to ensure compatibility with the Windows
CE.NET decoder.
Power Management
Q: What system power states does the Microsoft sample Power Manager
implementation understand?
A: It defines four states: "On", "UserIdle", "SystemIdle", and
"Suspend".
When the user is actively doing something with the system it goes to the
"On" state. If the user stops using the system, it will drop to the
"UserIdle" state. After more user inactivity it will go to the
"SystemIdle" state. As long as long as device drivers are actively doing
things the system will remain in this state, but if device drivers become
inactive the system will go to the "Suspend" state.
The "UserIdle" state is intended for use when the user may be using the
device (e.g., looking at the display) but not actively interacting with it.
The "SystemIdle" state is intended for use when the user is not directly
using the device but system processes on it are active. For example,
during file transfers the user might consider the device to be idle, even
if system processes are actually doing work.
The sample Power Manager implementation makes decisions about user and
system activity based on two activity timers: "UserActivity" and
"SystemActivity", respectively. The timeouts for transitioning between
these system power states is different when the system is on AC power from
when it is on battery power.
The sample platforms provided with Windows CE are all AC powered. OEMs may
choose to implement a separate set of power states for use when the system
is on battery power, in a cradle, in range of a high-bandwidth RF network,
etc. These kinds of customizations can be implemented by copying the
sample Power Manager PDD to the platform directory and modifying it
appropriately.
Q: I want Power Manager to suspend my system after it's been inactive for
a while. How do I set that up?
A: The sample Power Manager implementation supports a set of timeouts
associated with system power state transitions and links them to activity
timers. To enable this code, you need to declare the activity timers and
send the timeouts in the registry. See public\common\oak\files\common.reg
for an example of how to do this.
Q: I thought Power Manager would suspend my system after some period of
inactivity but it's not happening. What's going wrong?
A: System power state transition timeouts are defined in common.reg if
you
have included the Power Manager component. Double check that these
registry values are set up on your system.
If the registry settings look ok, turn on some debug zones to see what's
going on. The "timers" and "platform" zones are a good start. It's
possible that some component in your system is resetting inactivity timers
and preventing the system from suspending.
Drivers
Q: How do I write a USB driver for my Pocket PC?
A: That will depend on what sort of driver you're trying to write. Your
Pocket PC probably doesn't have USB host hardware so you cannot usefully
write any USB client drivers for your Pocket PC unless it has the necessary
hardware (which some few do). Those that do have the hardware probably ship
with USBHID, printer, and storage class client drivers. If you want to
write other client drivers you can check the sections in Platform Builder
documentation that pertain to USB client drivers.
Windows CE ships with OHCI and UHCI drivers so you shouldn't need to write
a host controller driver unless you're an OEM building a Pocket PC device
that has a non-standard host controller. The Platform Builder documentation
has some guidance on how to do that and on how to arrange for your driver
to interact with USBD. If you're trying to write a function-side driver to
make your Pocket PC appear to the host as something other than an
ActiveSync client, then you're basically on your own. You'll need to know
which function controller is being used on your specific Pocket PC and
you'll need to get intimate with the data sheets for that controller as
well as with the USB specifications. There currently are no upper-level
WinCE APIs defined for function-side USB drivers.
Other
Q: Can Platform Builder 3.0 and Platform Builder 4.0 coexist?
A: There should be no problem with this as long as they are installed to
separate directories.
Q: In the Windows CE.NET (4.0) documentation (topic: Creating Physical to
Virtual Mappings) it reads:
"After the kernel creates the original mapping during the boot process, an
application or the OAL can add to the statically mapped virtual address
pool by calling CreateStaticMapping or NKCreateStaticMapping. Memory mapped
in this way is located in range C400 0000 to E000 0000 and is created as
uncached memory only."
But for the ARM processors, this function does something completely
different. It does a lookup in the hardcoded OEMAddressTable, so it
doesn't add to the statically mapped virtual address pool. As a result,
the range doesn't match the one described in the documentation.
A: It is true that NKCreateStaticMapping doesn't create new region (same
on SHx). Instead, it just returns existing mapping.
Q: I've created a Platform SDK for my platform for use with Embedded VC++
4.0. When run under Platform Builder, the emulation environment runs just
fine. I've created the MSI package and it installs fine and is available
from the eVC design environment. My project compiles successfully and when
I start debugging all files are downloaded. The emulation window appears,
but my application never runs. Why?
A: This is likely resolved by disabling KITL in the Platform Builder
platform image, which is enabled by default. To do this, when configuring
the new platform image via the platform wizard, the last dialog will give
you the option to "modify your build options." Click this and then uncheck
"enable KITL." When you are done building your platform, export your SDK
with this platform, then install and use it as you have tried before. The
emulator cannot connect with an SDK that has KITL enabled.
Q: When I build I've recently started getting an error "Image is too large
for current RAM and RAMIMAGE settings". What does this mean?
A: This warning means that the size of the image you built is larger then
the amount of memory you specified in config.bib.
Q: How do I find out which components are provided by the Platform Builder
for Windows CE .NET?
A: The following website outlines the core operating system components as
well as the optional modules that you can utilize for additional
functionality:
http://msdn.microsoft.com/library/en-us/wcemain4/htm/_wcesdk_windows_ce_modu
les.asp
Windows CE Application Development Frequently Asked Questions
Q: What development tools can I use to target Windows CE-based devices?
A: The Microsoft eMbedded Visual Tools 3.0 (eVT) includes both Microsoft
eMbedded Visual Basic 3.0 (eVB) and eMbedded Visual C++ 3.0 (eVC). The
eMbedded Visual Tools can target the following:
- Palm-size PC's running Windows CE 2.1x
- Handheld PC Pro devices running Windows CE 2.1x
- Handheld PC 2000 devices running Windows CE 3.0
- PocketPC 2000 devices running Windows CE 3.0
- PocketPC 2002 devices Windows CE 3.x
Microsoft eMbedded Visual C++ 4.0 can target devices running Windows CE
NET. eVC 4.0 has been designed so that it can be installed on the same
system as eVC 3.0 without disturbing the operation of eVC 3.0.
In addition, custom devices (those not included in the list above) may
include support for eVB and/or eVC. Please contact your device
manufacturer for more information.
The Microsoft .NET Compact Framework is a subset of the .NET Framework that
is designed to run on smart devices, providing support for managed code and
XML Web services. Because the .NET Compact Framework is a subset of the
NET Framework on the desktop, developers who are familiar with .NET will
find it very easy to write .NET applications for smart devices.
Smart Device Extensions for Visual Studio .NET is a set of enhancements
that extend Visual Studio .NET, enabling developers to develop, debug, and
deploy applications for devices running the .NET Compact Framework. These
extensions include device-specific functionality for Visual C# .NET and
Visual Basic .NET, remote device debugging capabilities, device emulation,
and a number of other features.
Q: Where can I get these development tools?
A: eVT3.0 is available for free download from the following site:
http://www.microsoft.com/mobile/downloads/emvt30.asp
eVC4.0 is available for free download from the following site:
http://www.microsoft.com/downloads/release.asp?ReleaseID=37662
The .NET Compact Framework is currently in Beta. For more information on
how to receive the Beta, please see the following site:
http://www.gotdotnet.com/team/netcf/beta.aspx
eMbedded Visual Basic
Q: How can I automate the MediaPlayer from eVB?
A: Unfortunately, eVB cannot automate the MediaPlayer. There are a
couple
of alternatives to play media files from eVB:
1. Launch the MediaPlayer with the CreateProcess API with the media file
as
one of the command line parameters.
2. If you're just playing a .wav file, use the PlaySound API.
3. There is a Windows Media Player for Pocket PC SDK available on the
Microsoft website. Unfortunately, it does not support usage directly from
eVB. There is an eVC sample that downloads with the SDK: "The SDK also
includes a code sample that demonstrates how to embed the control in a
custom C++ program using Microsoft eMbedded Visual C++®." So you could
conceivably wrap it in eVC and expose it to eVB.
http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?ur
l=/msdn-files/027/001/877/msdncompositedoc.xml
Q: How can I display JPEG, GIF, etc. files?
A: The PictureBox control that ships with eVB only supports BMP and 2BP
file formats. To display other graphics formats, third party controls can
be used. Here are several alternatives:
- S309PictureBox Control:
http://nsbasic.com/s309/
http://www.microsoft.com/mobile/developer/technicalarticles/picturebox.asp
- Imgdecmp
http://www.conduits.com/ce/dev/imgdecmp.htm
- OleThingo
http://www.thingo.co.nz/products/OleThingo/
Q: When I try to target my Handheld PC 2000 device from eVB, I get a
message that 'The targeted platform does not match the device currently
connected to your system'. Why?
A: On all processors except CEPC, the following needs to be added to the
device registry in order for eVC and eVB to recognize the platform and
allow files to be downloaded properly:
HKEY_LOCAL_MACHINE\Windows CE Tools
String Value
Platform={0F9D255B-97DA-4641-A8E6-7A7411D2472F}
Once the entry is made, do a soft reset of the device for the changes to
take effect.
Programming with Databases
Q: How do I convert my Access database to a CDB database to use with eVB
on the device?
A: This third party site has a good explanation:
http://www.devbuzz.com/content/zinc_convert_database_mdb_to_cdb_pg1.asp
Q: Can I use the Seek and Find methods in eVB with a Pocket Access
database?
A: No. Seek and Find, while implemented in ADOCE 3.1, require OLEDB
support (as is found with SQL for CE). The CEDB database provider is not
OLEDB-based and does not have support for Seek/Find. CEDB is the database
provider that's used with CDB files.
In other words, Seek and Find only work when using ADOCE 3.1 with SQL for
CE.
Q: What are the limits for Pocket Access databases and ADOCE?
A: Under Windows CE 2.1x devices:
- max record size 128K
- max Database file size 16MB
- max fields count no limit
- max prop size 64K
- max sort order 4
- max number of objects 64K
Note, an object can be thought of as a chunk of data in the object store or
in a database volume. These are some of the different kinds of objects:
- Registry key or value (obj store only)
- Directory (obj store only)
- File header (obj store only)
- Data block - up to 4kB of file data, or up to 4kB of a database
record
- Database header
Under Windows CE 3.0 devices the limits for 3.0 are the same as listed
above, with the exception of the last one. One table in a database file is
limited to 64k records, but a database file in general can have more (by
having more than one table in it). The max number of *objects* (records,
tables, 4k chunks of property data) is 4096*1024=approx. 4 million
Q: When I write around 15,000 or so records into a database on my
PocketPC, the device locks up.
A: Unfortunately there is a bug in CEDB on Windows CE 3.0 that leads to a
hang when a database that is sorted on strings reaches around 15,000
records. It is interesting that you made it as far as 40,000 records, but
the hang is unpredictable, varying based on data insertion order, and can
happen on a seek (not just on an insert). So that is probably what you are
up against. There is a QFE that fixes this, QFE 31 I believe, but
unfortunately you cannot apply it on a released device.
It must be put into ROM so it can only be done by the OEM. So,
unfortunately, the only thing left to you is to either break your data up
into smaller databases of around 10,000 records, or not to sort on strings.
Both are unpleasant.
Instead try switching to working with SQL-CE instead of CEDB. It doesn't
have the bug, and it has better performance for large databases anyway.
General Windows CE Development
Q: Are there any memory leak detection tools I can use?
A: There are a couple of third parties which provide such tools:
1. Entrek - CodeSnitch or ProcMan
http://www.entrek.com
2. CodeGuru
http://www.codeguru.com
Q: Are there any tools I can use to edit the registry on the device,
without being connected to a host?
A: There are third-party tools, none released by Microsoft. See PHM
Registry Editor for example:
http://www.phm.lu/products/PocketPC/regedit.asp
Additional Resources:
The following active newsgroups are available for posting
- mcrosoft.public.windowsce.platbuilder
- mcrosoft.public.windowsxp.embedded
- mcrosoft.public.windowsnt.embedded
- mcrosoft.public.windowsce.embedded
- mcrosoft.public.windowsce.embedded.vc
- mcrosoft.public.windowsce.embedded.vb
- mcrosoft.public.pocketpc.developer
- microsoft.public.dotnet.framework.compactframework
- microsoft.public.windowsce.app.development
- microsoft.public.win32.programmer.wince
Windows CE.NET Operating System
Windows CE .NET Tips
http://www.microsoft.com/windows/embedded/community/tips/ce.net/default.asp
Frequently Asked Questions
http://www.microsoft.com/windows/embedded/ce.net/evaluation/faq/default.asp
Frequently Asked Questions (Steve Maillet's site)
http://www.entelechyconsulting.com/EmbeddedFAQ/EmbeddedFAQ.htm
Windows XP Embedded
WindowsXP Embedded Tips
http://www.microsoft.com/windows/embedded/community/tips/xp/default.asp
Frequently Asked Questions
http://www.microsoft.com/windows/Embedded/xp/evaluation/faq/default.asp
Windows Server Appliance Kit
Frequently Asked Questions:
http://www.microsoft.com/windows/Embedded/sak/evaluation/faq/default.asp
Windows CE Application Development
Microsoft .NET Compact Framework and Smart Device Extensions
http://www.gotdotnet.com/team/netcf/
Microsoft eMbedded Visual C++ 4.0:
http://msdn.microsoft.com/vstudio/device/datasheet.asp
ADOCE:
http://pocketpcdn.com/sections/ado.html
http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?ur
l=/MSDN-FILES/027/001/490/msdncompositedoc.xml&frame=true
Microsoft eMbedded Visual Basic
Frequently Asked Questions About eVB3:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q260081
http://www.devbuzz.com
http://support.microsoft.com (searchword: eVB)
http://www.pocketpc.com
http://www.pocketpcdn.com