views:

450

answers:

3

Is it possible to create a small program that will run, without recompiling and without emulators, on both Windows CE 6 AND Windows XP SP3?

From my knowledge, this isn't possible. Source code needs to be recompiled for the target platform. However, a hardware manufacturer for embedded boards is claiming otherwise.

The application isn't anything complex, just a simple benchmarking tool analysing floating point operations, CPU ticks etc, and displaying the results on a plain GUI.

A: 

No, impossible. Both use the PE format, but the machine type differs. Hence any PE file will run on precisely one architecture.

In comparison, Apple OSX supports "fat" binaries which can support multiple machine types (via aggregation, the single binary acts as a container).

MSalters
+2  A: 

.NET Compact Framework applications can be run on desktop computers with the full .NET Framework as long as they only access the shared parts of both frameworks, though their user interface can not be upgraded to look like that of an application developed for desktop PCs.

In other words, if you write it targeting the .NET CF for CE, you can still run the same binary on an XP machine

Bilko
A: 

The last time I used Windows CE there was a version for x86. With careful coding you can detect if you're running under Windows CE or "real" Windows, and execute appropriate code for one or the other.

The .Net answer is kind of cheating. Half of the compilation is from your programming language to IL and doesn't need recompilation (if you're careful). Half of the compilation is JITting and always needs recompilation.

Windows programmer