Microsoft Embedded C++

Recently I bought a PDA running Microsoft's Pocket PC 2003 operating system. I thought it would be interesting to try to develop some software for it.

Microsoft make Embedded Visual C++ available for free. It's a version of Visual C++ (which most definitely is not free) dedicated to writing code for embedded systems. It even comes with a PDA emulator which you can test your programs on without the risk of crashing your actual handheld :)

I was surprised (perhaps more than I should have been) to find that things in the embedded world are very similar to the desktop environment. The code to dump a simple dialogue on the screen, for instance, is the same.

However I was having trouble testing my modified Hello World program. Microsoft's example was - like all Microsoft examples - big, bloated and full of Hungarian notation. I thought I'd distilled the essential parts but my program wouldn't display a window either on the emulator or my PDA. The task manager (conveniently buried under Settings / Memory / Running Programs with no direct shortcut) listed the program as running. Just invisibly.

As an aside I also found the emulator didn't correctly terminate programs, leading me to think I'd forgotten some crucial cleanup code. No. It's just that the emulator is broken. My PDA handled the application exit without any problems.

After about an hour copying and pasting various bits from Microsoft's sample code into my own, I still couldn't get my dialogue to display. What could I be doing wrong?

Finally I found the problem. The dialogue window I had designed in Visual C++ was too wide for the PDA, which decided that the best solution to the problem was not to show anything at all.

I reverted to my original code, resized the dialogue and recompiled. Guess what? It worked first time.

Yes folks, by default Microsoft's own tool for dealing with Microsoft's own embedded systems will create windows that will not display on those systems without further developer action.

It's time for The Picture.

Who's responsible?  You fucking are.