Blog

How to ask questions on the Microsoft Forums

This page is also available in Italian. Want to translate into your language? Let me know!

There are certain rules when you use a community driven forum to get answers to your questions. The Microsoft forums that deal with Platform Builder and Windows CE development are not actively monitored by Microsoft. The people answering your questions are your peers; volunteers who spend their time researching your problem because they find it interesting and want to learn more.

The people that post most answers are in many cases MVPs, Most Valuable Professionals, a status awarded by Microsoft to people who help out the community by running user groups, answering questions in forums, etc.

It is important to note that nobody is being paid to answer questions. They're all volunteers.

Now that you know this, you also know that there is no guarantee to get an answer. The most common reasons for not getting an answer are:

  • Your question has been answered in the forum in the past
  • Search before you ask!

  • You didn't supply enough information
  • "I call this function and it doesn't work, please help" is useless.

  • You keep on posting the same question over and over
  • If nobody answered your question after a couple of days it is because you didn't read this blog post on how to ask questions or simply because nobody knows an answer. If you want to "reactivate" your question, post a reply to your own question with something like "Anybody? Please?" and supply any other relevant information you may have gathered over the past few days. Do not start another thread for the same question. It is annoying and will result in people ignoring you.

  • You demand a quick answer
  • Demanding things from people you do not pay any money is generally counterproductive.

  • You're asking your question in the wrong forum
  • Before asking a question make sure you read at least some other questions and answers in the forum so you know this is the right forum. The forum title usually helps to determine this as well... ;)

Note that the above says nothing about "stupid" questions. That is because stupid questions do not exist! Everybody on the forums started with Windows CE/Embedded Compact at some point, and everybody struggled with the (sometimes) steep learning curve in the beginning. We know where you are coming from so don't be shy and ask, but before you do, take note of the following "rules" that will increase your chances in getting a useful answer:

  • Read MSDN Library
  • This sounds logical, but you'd be surprised how many questions are asked that can be easily found in MSDN. Click here for all the Windows Embedded documentation and use the search box in the top left hand corner to search. When you use search, make sure you check if the description you see is for "desktop" Windows, or for Windows Embedded. As you know, Windows CE/Embedded Compact uses a subset of the big Win32 API and some API parameters have different meaning in CE/WEC, so be careful there! That said, sometimes the big Win32 API description lists more information that also applies to and is still useful for CE/WEC. First thing to do when you encounter a problem with an API is to open the description of that API in MSDN, check all the parameters and read the remarks section. The remarks section has useful information about error conditions and special requisites that may be needed for the API. If you encounter a problem in the documentation, or missing information or something else wrong with the documentation make sure to rate the topic and/or add the missing information using the "Community Content add" link. The people at Microsoft responsible for the documentation really read this feedback and will update the documentation where necessary. Help make the documentation better!

  • Before asking a question, search the forums for an answer
  • If you can't find an answer in the forums you may also try to search the newsgroups archives (they were used before the forums and contain years and years of information about Windows CE):
    Use Google Group Search to search the newsgroups. Type some keywords in the "with all of the words" box, then in the "Return only messages from the group at this location" box type *windowsce* to search all newsgroups related to Windows CE. I also usually set the form to "Return 100 messages" and "Sort by Date" so I get the latest answers on the top of the list.

  • Subscribe to blogs
  • Most MVPs and some people within the Microsoft Product Team have blogs. Blog posts usually deal with a FAQoaF (a Frequently Asked Question on a Forum ;o), like the "What to build when" post on this blog. Some of the blogs that I subscribe to are the Windows CE Base Team Blog, Mike Hall's Windows Embedded Blog, the Windows Mobile Team Blog and of course the GuruCE Blog.

If your search did not return a useful answer you can post a question to the forum, but before you do: try a debug build, get KITL going and analyse the debug messages. If you can't build a debug kernel or get KITL going it will be difficult to get to the root of the problem, but not always. If you can't get KITL or a debug build going list that in your question!

Information that should be in your question:

  • OS version / hardware / board / kernel / updates
  • List the OS version, what hardware, what processor, what board, what BSP, debug or retail kernel, KITL yes/no, and what updates (QFEs) you installed

  • Specific Component
  • If you have problems with an existing driver or a specific component; tell us! Saying "I've got a problem with the touch driver" is useless, because there is no such thing as the touch driver. If you made the driver; tell us. If you cloned a driver, tell us which driver you cloned (including the original path you cloned from). If you are having problems with a standard driver, tell us exactly which one including the complete path. Example: "I've got problems with the MainstoneIII touch driver located in C:\WINCE600\PLATFORM\MAINSTONEIII\SRC\DRIVERS\TOUCH"

  • Big picture
  • Explain what you want to accomplish, not how you want to accomplish it. There may be better ways to get where you want. Describe the bigger picture.

  • What did you try
  • List the things you tried, the tests you performed and why it didn't work. If people ask you to perform another test: do it! Don't expect an answer if you are unwilling to follow advice that may lead to the solution of your problem. Also, if your search found a solution to your problem but somehow it didn't work, list that too.

  • Detailed error messages
  • If you got an error, list it. If an API returns an error, get the error number by calling GetLastError() and list it.

  • Detailed debug messages
  • Post the debug message lines that you think are relevant to the problem. Do not post 6000 lines of debug log because nobody will want to read through all of that.

  • Be polite
  • Don't demand an answer. Remember nobody is being paid to answer your questions. If you want paid support, buy support from Microsoft or one of the Embedded Partners, like GuruCE. Same goes for people answering questions; be polite, remember your own struggles when you started with CE.

  • Proof read / Spell check
  • We understand English is not the language the entire world speaks fluently; it's not my native language either. Spelling mistakes are common and not a problem at all, but before you post; at least read back what you wrote and make sure it is understandable. Don't just check for funny sentences and spelling mistakes, make sure there is enough information in the message for other people to understand your problem. The quality of the answer can only be as good as the quality of the question!

  • MSN/SMS/Text Generation
  • Remember you are not paying per-byte on the forums so please refrain from trying to shorten your messages. Do not use "ur" instead of "you're" or "2" instead of "to". It makes the message unreadable/annoying. R3m3mb3r typing l1k3 th1s do3s n0t m@k3 u 3733T, 1t 1ly m@k3$ u l00k st00p1d!

If you follow these rules (that are valid for any community driven forum) then there are no stupid questions and you will most certainly get an answer from one of the many volunteers answering questions in the forums.

Here's a template you can use to ask questions in the Windows Embedded Compact forums:

OS........: [CE 4.2 / CE 5.0 / CE 6.0 R2 / WEC7] [with updates until February 2012]
Hardware..: [Custom board / Device Solutions Topaz / etc]
Processor.: [iMX25 / PXA320 / etc]
BSP.......: [Custom BSP based on Mainstone III / GuruCE Topaz BSP / etc]
Kernel....: [Debug / Retail / Checked] [KITL enabled/disabled]

I am trying to [explain what you are trying to accomplish]

I am using [list the related component/driver including the full path]

I've tried to [explain what you have tried so far, how you tested, etc]

I searched the web and the forums and found [this/nothing]:

[url to something relevant]

I've tried to implement that but it didn't solve my problem because [explain why not]

Here's the code I use:

[show a code snippet if relevant]

The call returns [whatever the call returns] and GetLastError() returns [whatever error it returns]

The debug output window shows this:

[list a couple of lines around the debug log lines that you think are relevant]

I would much appreciate any pointers you can give me.

Thanks!

[Your Name]

Two final requests: When someone answers your question be sure to mark that reply as the answer. It is just a token of your appreciation and recognition for that person. Also: Return the favor!

Once you find a solution to your problem, either by yourself or because of a tip from somebody on the forums, please spend 5 minutes to write it down and post it as a reply to your original question. Your solution may save somebody a lot of time and frustration in the future.

Why not become part of the community? Don't be afraid to answer questions if you think you know the answer!

CE 6.0 / R2 BSP template

The Windows CE Base Team just posted a CE 6.0 template for a BSP on their blog:

http://blogs.msdn.com/ce_base/archive/2008/05/30/bsp-template-now-available-for-ce-6-0-ce6r2.aspx

The template contains help and instructions on how to use the template as a base for your own BSP:

The BSP Template is designed to help developers who are new to Windows CE BSPs. It is also designed to assist developers who want more information on a specific CE BSP technology.

It contains information on KITL, bootloader, drivers and the OAL. If you are developing a BSP, porting a BSP from 5.0 to 6.0, developing drivers or are just interested in BSP development for CE 6.0 then download it and learn!

Download QFE's

[UPDATE: the links in this blog post do not work anymore. For updated links click here]

How do you find the list of updates available for CE 4.2, 5.0 or 6.0?

The official way is to go to http://msdn.microsoft.com/en-us/embedded/aa731256.aspx and yes, it does show the QFE's for the various versions but wait...

...there's more!

Like the USB 6.0 webcam source, or the various help updates, or eVC 4.0 SP4, or the run-time assesment tool, or the mainstone BSP update, or ...

All things you may like to download too but that you won't find on the "official" page for downloading CE updates. If you'd like the complete list try these links:

CE 4.2

CE 5.0

CE 6.0

They show you 50 downloads per page sorted from new to old. Handy!

PS. Don't forget to download the QFEInstaller so you don't have to click the QFE installation wizard a million times: QFEInstaller

Command Line Build

This post will show you how to create a batch file that will build your Windows CE OS without using the Visual Studio/Platform Builder IDE.

Often the question is asked how to setup an environment which automatically extracts all information from version control and then builds your code. There are a lot of tools that can help you do that: an open source alternative can be found at http://cruisecontrol.sourceforge.net.

To build your kernel without having to use the IDE create a batch file with the following content:

@echo off
SET _WINCEROOT=C:\WINCE500
SET _OSDESIGNDIR=%_WINCEROOT%\PBWorkspaces\YOUR_WORKSPACE_FOLDER
SET _OSDESIGN=%_OSDESIGNDIR%\YOUR_WORKSPACE_FILE.pbxml
SET _OSDESIGNCONFIG=YOUR_OSDESIGN_CONFIG_NAME

"%ProgramFiles%\Windows CE Platform Builder\5.00\CEPB\BIN\pbxmlutils" /getbuildenv /workspace "%_OSDESIGN%" /config "%_OSDESIGNCONFIG%" > SetEnv.bat

cd "%_OSDESIGNDIR%"
call SetEnv.bat
del SetEnv.bat
cd "%_OSDESIGNDIR%"
blddemo clean -q

Note that for CE 6.0 pbxmlutils is located in "%ProgramFiles%\Microsoft Platform Builder\6.00\cepb\IdeVS\" and you use SET _WINCEROOT=C:\WINCE600

You need to replace the first 3 SET variables to match your specific project:

YOUR_WORKSPACE_FOLDER: Workspace folder which is located under the PBWorkspaces (CE 5.0) or OSDesigns (CE 6.0) folder. This is the folder that contains YOUR_WORKSPACE_FILE.

YOUR_WORKSPACE_FILE: The name of your OS Design workspace; the file with extension .pbxml. This file is located in YOUR_WORKSPACE_FOLDER.

YOUR_OSDESIGN_CONFIG_NAME: This is the configuration name you select in the IDE of Platform Builder, eg Emulator: x86_Release. You can also open your .pbxml file with notepad to find out what the configuration name is (search for Configuration Name).

Happy building!

Windows CE Task Manager

I found a great tool to monitor the CPU load on your Windows CE device, which includes the source code!

http://urana.info/mobile/wince/itaskmgr/index.html

Offline installation of the CE 6.0 R2 update

The Microsoft installer for the CE 6.0 R2 update is a webinstaller. This means there is no way to download once - install often. Since the complete R2 update is over 1 GB of data it would be nice to be able to download the package to a folder from which you can install the R2 update offline. This is especially handy if you need to install the R2 update on multiple machines.

Another reason would be if you, like me, get errors during installation. When I tried to install the R2 update I got error messages like:

"Error 1335. The cabinet file 'MSI4E0.tmp' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package.".

So I dissected the MSI log files and was able to determine some downloaded cabinets were in fact corrupted. The corruption only seemed to occur when downloading using the Microsoft Installer package. When I manually downloaded the cabinets there was no corruption. By looking at the log files I could get a list of all required cabinet files. Since there are quite a few of those cabinets, and I figured this could be handy for more people, I wrote a tool that downloads the entire package from the Microsoft download server into a folder. Once the download is complete (1.1 GB) run the installer (Windows Embedded CE 6.0 R2.msi) to install the R2 update. You don't need to be connected to the internet while installing.

Download the tool (including source): DownloadCE6R2.zip

What to build when...

[An updated version of this post for WEC2013 can be found here]

A question that keeps coming back on the newsgroups is "I changed some code, but it does not end up in my image", or "I changed some registry values in platform.reg, but if I look at the device registry, it's not there!".

The source of these problems is build-related. You've got to understand the build system in order to know exactly what to do. This blog post aims to give you a clear handle on "What to build when"!

The first and most important thing to do is to delete two options from the Platform Builder Build menu: Build and Sysgen and Rebuild and Clean Sysgen. These commands will build the entire tree (so including any source in PUBLIC and PRIVATE). For us normal developers these commands do not make any sense. If you're not in the CE development team working at Microsoft you simply don't have all the source code. Rebuilding the entire tree may work, but it will override any installed QFE (QFE's contain updated binaries and sometimes, but not always, updated source code). After rebuilding the entire tree you will sooner or later encounter strange errors that are either very hard to fix, or just impossible to fix. There is no way to revert back to a clean tree once you've done a (Re)Build and (Clean) Sysgen. The only way is to completely remove Windows CE and reinstall. Don't forget to reinstall all QFE's after that as well (download the QFEInstaller tool to help with that).

Now you know why you often see me shouting NEVER EVER DO A BUILD AND SYSGEN! in the newsgroups...

UPDATE: The instructions for removing the bad build commands from the menu are for Windows CE 5.0/6.0. For instructions on Windows Embedded Compact 7 read this. Note that the below "What to build when" instructions are STILL VALID for WEC7 AND WEC2013!

The original menu
The original Advanced Build Commands menu

Step 1.
Customize toolbar
Right click on the toolbar and click Customize...


Step 2.
Delete Build and Sysgen
Click on menu Build, submenu Advanced Build Commands, then right click on Build and Sysgen and click Delete


Step 3.
Delete Rebuild and Clean Sysgen
Do the same for Rebuild and Clean Sysgen


Step 4.
The original menu
Close the Customize window. The Advanced Build Commands menu should now have only 4 options: [Sysgen], [Clean Sysgen], [Build Current BSP and Subprojects] and [Rebuild Current BSP and Subprojects].



If you are still using Platform Builder for Windows CE 5.0 the instructions stay the same except the Build menu is Build OS and there's no submenu (everything is under the Build OS menu).

I know that some developers working with CE change code in the PUBLIC and PRIVATE trees. If you do that you need to do a build and sysgen to include your changes in your kernels BUT: You will end up with a corrupted CE installation. If you need to change PUBLIC or PRIVATE code you have to clone the code. Cloning code is in most cases not much more than a simple copy. Copy the sources you want to change to a folder in your BSP, change the sources file so that it builds a DLL instead of a lib and voila, you're done. I know I make it sound easier than it is, but taking a shortcut and modifying code in the PUBLIC or PRIVATE trees will prove to be a long way around in the long run.

Phew! Now that we got that out of the way let's see what build command we've got to use in what situation:

  • Create a new OS Design (or add a new build configuration to an existing OS Design): Sysgen (Build Solution)
  • Since a new OS Design doesn't have anything in its build configuration's output folders (same with a new build configuration) you'll have to sysgen the entire solution (for that build configuration). The longest process, but luckily you don't have to do this many times (see below).

  • Change Platform Settings: Make image
  • Platform Settings
    If you change any Platform Settings (like IMGNOKITL, IMGNODEBUGGER, IMGPROFILER) all you have to do is a Make Image.

  • Change driver source code in your BSP: Build the driver and Make Image
  • If you change driver source code, all you have to do is just build the driver (WINCEREL must be set to 1 but it is set by default so unless you changed it there's no need to worry) and do a makeimg. If you only want to debug the driver you can also add the DLL to the Release Directory Modules list (menu Tools) and just restart the device (or reload the device driver on the device) without having to do a makeimg and download to device. Building just the driver is a simple right-click on the driver and Build in the IDE or "build" in the driver's folder on the command line.

  • Change multiple source code files in your BSP: Build the BSP and Make Image
  • The safe option, this way you can't forget to rebuild anything. Building the BSP is a simple right-click on the PLATFORM\BSP folder and Build in the IDE or "build" in the BSP's root folder on the command line.

  • Change platform.reg, bib, dat or db files in your BSP: Sysgen BSP, Copy Files to Release Directory, Build All Subprojects and Make Image
  • A lot of steps, but this will still not take longer than a couple of minutes. If you change any of the platform.* files we need to re-filter (Sysgen) those files and make sure the filtered files are copied into the FLATRELEASEDIR (Copy Files to Release Directory). That last action did however clear the project binaries from the FLATRELEASEDIR so we need to make sure those binaries and settings are getting copied into the FLATRELEASEDIR again (Build All Subprojects) and finally we are ready to Make Image. Now your registry changes will be in the image (check reginit.ini to make sure, last entry wins).

  • Change some source files and platform.reg, bib, dat or db files in your BSP: Build and Sysgen the BSP, Copy Files to Release Directory, Build All Subprojects and Make Image
  • Only difference with previous situation is that you now have to build the BSP to include the source code changes.

    Please note that "Build and Sysgen the BSP" is not the evil "Build and Sysgen" command. The evil command is only in the Build menu (and should not be anymore if you followed the instructions above). The "Build and Sysgen BSP" command can be executed by right clicking your BSP root node in the Solution Explorer and choosing "Build and Sysgen (cebuild -qbsp)". Notice the -q in that command? That shows you it's a good command...

  • Change the workspace configuration (add or delete a component): Sysgen the entire workspace (Build solution)
  • For most components a simple Sysgen is enough. For some components (like when changing from RAM based registry to Hive based Registry) a Clean Sysgen is needed. This action takes the longest (anywhere from 5 minutes for a small workspace configuration on a very fast machine to a couple of hours for a really big configuration and a very slow machine). A Sysgen is a right-click on the workspace, Advanced Build Commands->Sysgen in the IDE or "blddemo -q" on the command line.

  • After installing one or multiple QFEs: Clean Sysgen the entire workspace (Rebuild solution)
  • To make sure all components are re-linked with the (possibly updated) libraries a Clean Sysgen is needed. This action takes the longest (anywhere from 5 minutes for a small workspace configuration on a very fast machine to a couple of hours for a really big configuration and a very slow machine). A Clean Sysgen can be performed by choosing Rebuild Solution from the build menu, or choosing Advanced Build Commands->Clean Sysgen in the IDE or "blddemo clean -q" on the command line.

Sometimes it's easier to build from the command line. If you are unsure what command to type you can always perform the action in the IDE first and watch the 3rd line in the build output window starting with "Starting Build:". Behind the colon is the exact command line for that action, eg Sysgen on the BSP: "Starting Build: SysgenPlatform %_TARGETPLATROOT% preproc&&SysgenPlatform %_TARGETPLATROOT% postproc", so on the command line you would type "SysgenPlatform %_TARGETPLATROOT% preproc" followed by enter and the 2nd command "SysgenPlatform %_TARGETPLATROOT% postproc" followed by enter.

If you use the commandline, make sure you never forget "-q" when running "blddemo" as "blddemo" without "-q" is a Build and Sysgen!

I hope this blog post will help you speed up your builds and lower your frustration with the build system!

Good luck!

Air New Zealand Crash!

Last Sunday I got the biggest scare I have ever had on a plane. I am not scared of flying, in fact I love flying, but this time I got really, really, really scared...

I was watching a movie on the in-flight entertainment system. It was the middle of the night, half the plane was asleep when all of a sudden the stewardess taps me on the shoulder and says:

"Sir, we are shutting down the entertainment system because we are crashing..."

At that moment my heart rate went through the roof, I immediately started looking around to see if there was turmoil in the plane, then looked at her and said "What? Are we crashing?!". Apparently I had misunderstood her, she must've said "it [the entertainment system] is crashing". The stewardess apologized for the bad choice of words and we had a good (& very relieved) laugh about it.

Of course all this would not have happened if the in-flight entertainment system had not crashed...

In retrospect I am pleased it crashed because it gave me some insight in the system behind the Air New Zealand in-flight entertainment system: It is running CE.

CE.NET 4.xI should've been excited about that and used an exclamation mark on that last sentence, but how can I be excited about a system that has to be rebooted every 6 hours? I can imagine an already nervous passenger would become very nervous when he realizes even something simple like the in-flight entertainment system crashes!

Besides that obvious "crashing" problem the control of the system is sluggish, sometimes even completely non-responsive. The graphics of the "Air Show", the application that shows where the plane is, is however very impressive and looks very smooth. The board running CE is definitely fast enough to support fast 3D graphics and streaming video so why is control so slow? And why the crash?

I think the problem is that the company that designed the in-flight entertainment system used (this is an educated guess) the Internet Explorer as a host for the "Entertainment" application. The crash is probably caused by a memory leak in the browser application. Bad design? I think so...

Windows CE is a real-time operating system that can run 24/7 without ever having to reboot the system. In fact, several customers have been running CE devices for several years without ever having to reboot their device. I'm just saying I would love to take a closer look at the Air New Zealand entertainment system and see whether my educated guess is close to the truth.

So... Rockwell Collins (or Air NZ): Give us a call. I'm sure we can help you create a much more robust and responsive system.

Here's a funny side effect of a "mid-air crash" of the Air NZ in-flight entertainment system: LA to Auckland in a little over 6 hours with a Boeing 747-400, now THAT'S impressive! (Normal flying time is around 12 hours, video is bad quality but it says 6 hours 13 minutes...)
CE Boot 2
More info:
http://www.rockwellcollins.com/news/page5495.html

Welcome!

The first entry of the GuruCE blog of course has to be a special one!

Therefore, we start this blog with a tool I developed in the past:

The QFE Installer

Ever had to reinstall Windows CE? Then you had to reinstall all the QFE's as well. Not a nice task, it's lengthy and you have to stay close to your computer because there are about 12 screens you have click through before it actually installs. There is unfortunately no way to install all QFE's without a user controlling the mouse... until now!
The QFE installer installs all the QFE's you downloaded in the exact right order, from oldest to newest, without the need for one mouse click. Just copy the QFEInstaller.exe in the folder containing all the Windows CE QFE's and run it. Source available for free, just drop us a line.

Download QFEInstaller

Keep an eye on this blog for future tips & tricks and more tools for the CE developer!

Pages

Subscribe to RSS - blogs