I was merrily bashing away on a Compact Framework application for a demo this coming week when I had a flash-back to the Windows CE developers conference in the year 2000 – one of the advantages of the .NET Compact Framework is the portability of applications – the applications aren’t tied to a specific processor or operating system, it’s fun to demo an application targeting the Windows CE Emulator or a Windows CE based device and then run the exact same application on the desktop without changing a single line of code or re-compiling the application.

But, thinking back to the Windows CE developers conference I remember sitting through a pretty interesting session [I don’t remember who presented the session, but the content was super cool at the time] – the content being discussed during the session was CEF, the Common Executable Format, this was a new processor target within the eMbedded Visual C++ tools for Windows CE 3.0.

CEF only shipped as part of a Technology Preview at the Developers Conference, I think I still have a copy of the CD in my office somewhere – Here’s an extract from the CEF documentation on the MSDN/Embedded site.

How CEF Works
CEF provides processor compatibility for any application created to run on a particular device (for example, the Pocket PC or the Handheld PC, but not both). CEF does not provide for running an application on different devices/platforms.

Building a CEF application is simply a matter of choosing the WCE CEF configuration for the build process. During compilation, this configuration invokes the clcef.exe compiler to generate code. When linking, it invokes the linkcef.exe linker. The final binary is output in the same manner and named in the same manner as processor-specific executables, but marked with a machine type of CEF within the binary.

When a user installs the common executable on a CEF-enabled Windows CE device, the translator translates the common executable file to the native executable file. Translators are available for all Windows CE-supported processors. Two modes of translation are available with CEF: device-side translation or host (desktop)-side translation. The device-side translator generates a native executable from a CEF executable with the translator resident on the device ROM. The host-side or desktop (PC) translator generates a native executable with a translator resident on the desktop. The host-side translator is made available with embedded Visual C++.

Pretty interesting eh? – this leads to an interesting question… if you’re writing processor independent code for Windows CE today you will be using C# or VB against the .NET Compact Framework – would managed C++ be interesting for Windows CE ?

– Mike