August 2010 Entries

Windows CE: C# Application to Format TFAT
Windows CE: C# Application to Format TFAT In Windows CE: Formatting TFAT I show how to format a disk with TFAT using C/C++ code. The customer that I wrote that for develops using C#, so I wrote a C# application to test the formatting code. To me, most formatting tools are just too difficult for the average user. In this case, the user will be someone working in the factory or field service. They just need to select a disk and request that it be formatted. The application dialog look like: It has ......

Posted On Monday, August 30, 2010 10:34 PM | Comments (3)

Windows CE: Formatting TFAT
A customer came to me for assistance in formatting an SD card with TFAT. I did a quick look in the control panel code to find how it formats disks as TFAT and told the customer to use FormatVolume() and set the FORMAT_OPTIONS dwFlags FATUTIL_FORMAT_TFAT flag. I assumed that it was that easy and left the customer to write the code. A few weeks later the customer came back to me and said that they just couldn’t get FormatVolume() to work, let alone format the disk as TFAT. So this time I dug deeper ......

Posted On Sunday, August 29, 2010 10:42 PM | Comments (7)

Windows Compact: Discussion Forums
I monitor some Windows Compact (the new name for Windows CE) Forums for a few reasons: I learn a lot from others working on Windows CE, so many of you are running into the same issues that I run into. Sometimes you run into them before I do, other times I have already run into the issue. I learn a lot from answering questions. You might be surprised to find that sometimes I don't already know the answer, so I do some investigation to get the answer. Sometimes I am wrong, or there is a better way, ......

Posted On Wednesday, August 18, 2010 7:53 PM | Comments (14)

Platform Builder: Write, Debug, Fix, Debug…
The question came up again about how to quickly test an application or driver using Platform Builder and KITL. This article will show how this test cycle can be done quickly without building a new OS and downloading it. Of course Platform Builder is a tool for developing an operating system, so if you use its default behavior it will build an operating system. So that means that a small change to source code means building the operating system and deploying it to your device. But we will look at ......

Posted On Tuesday, August 17, 2010 8:28 PM | Comments (2)

Windows CE: Disable the Taskbar for Full Screen Applications
In the article Windows CE: Setting an Application to Display Full Screen in C/C++ I discussed how to show an application full screen using C++. I discussed that for a kiosk application that the easiest way to disable the Explorer shell taskbar is to simply not have the Explorer shell launch when the system starts up. But there are cases where having the Explorer shell run underneath the kiosk app has value in some cases. The trouble is that the taskbar will still respond to special keys like the ......

Posted On Sunday, August 15, 2010 10:59 PM | Comments (0)

Windows CE: Setting an Application to Display Full Screen in C/C++
Many, maybe even most, Windows CE devices are single purpose devices that have an application that fills the entire screen. So of course setting the application to entirely fill the display is important. In this article we will explore setting an application to display full screen using C/C++. My plan is to create a simple application that fills the screen with white and displays two buttons, exit and explore. Those may be odd buttons for a kiosk application, but they will come in handy while working ......

Posted On Friday, August 6, 2010 10:47 PM | Comments (0)

Windows CE: Launching an Application when a Network Connects
I was working on a headless system recently and wanted to run cemgrc.exe when a network connection was made. That inspired me to write a little application to do it. I decided to make the application flexible, so I added a few requirements; be able to run from HKEY_LOCAL_MACHINE\Init, and read the application name and command line from the registry. Working backward, I wrote a function to read the registry to get the application name and command line and then start the application using CreateProcess(). ......

Posted On Thursday, August 5, 2010 9:07 PM | Comments (0)

Windows CE: Writing an Application to Test GPIO Pins
Download GPIO Example driver and appplication source code In previous articles I have developed a driver to access GPIO Pins, Windows CE: Using a Driver to Read/Write Hardware Registers, and a wrapper API for the driver, Windows CE: Developing an API to Access a Driver. Now it is time to use them from an application. Because the real work is done in the driver, and because we have some simple to use wrapper functions, this application is very simple. It starts by calling the InitGPIOAPI() function, ......

Posted On Sunday, August 1, 2010 7:33 PM | Comments (14)

Windows CE: Developing an API to Access a Driver
Download GPIO Example driver and appplication source code In my article on reading and writing GPIO pins from a driver (see Windows CE: Using a Driver to Read/Write Hardware Registers) I developed a driver that exposes GPIO pins through DeviceIoControl() calls to the driver’s XXX_IOControl() function. Using DeviceIoControl() can be messy, so developing wrapper functions helps clean that up, but if the driver developer also created the wrapper and provided it as an API that would help. An API is really ......

Posted On Sunday, August 1, 2010 5:48 PM | Comments (6)

Windows CE: Using a Driver to Read/Write Hardware Registers
Download GPIO Example driver and appplication source code A recent discussion thread in the Windows Embedded Compact Platform Development forum made it clear to me that for new Windows CE Software Engineers doing something as simple as accessing a hardware register can be very difficult. In the old days, Windows CE 5.0 and before, it was very easy; write an application that allocates a virtual address and then read or write a register. The problem with that is that allowing applications to access ......

Posted On Sunday, August 1, 2010 4:21 PM | Comments (14)