Multi-platform application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is it possible to have the same source code compiling for both .NET compact
framework and full framework?? I.e, is it possible to have an application
that can be ran both in a desktop machine and in a Handheld device (2
separate executables, off course)? I cannot use an web application.

If this topic has already been commented, could you please provide me the
link to the discussion?

Thanks in advance.
 
Yes with a couple of caveats. In fact it is in some cases possible to create
a single .exe built as a device project which will also run on the desktop,
but note the reverse (running a desktop .exe on the device) is not possible.
Differences include:-
..NETCF is a subset of the .NET Framework, so you should design with the
device functionality in mind rather than use desktop features and then be
stuck with how to implement these for the device
..NETCF includes a couple of libraries not present in the full framework-
Microsoft.WindowsCE.Forms, System.Net.IrDA and System.Data.SqlServerCe
File paths are different on Windows CE - no drive letters and all paths are
absolute
Platform Invoke to API functions is platform specific - different versions
for desktop or device

You can use conditional compilation constants in your code to provide
alternative blocks of code for desktop and device e.g.
#if DEVICE
// device code
#else
//desktop code
#endif
You can then setup the DEVICE constant in your smart device project. If you
create a desktop project in the same folder you can add the source files and
they will be shared between both projects.

Peter
 
Thanks Daniel and Peter. This information was exactly what I was looking for.
I'm proceeding to development right now!

Cheers,
Regis.
 
Back
Top