My suggestion would be to put the actual functionality of your app into a
DLL and then creating 3 seperate projects for each platform - each of which
would simply be for a UI that leverages the shared DLL.
When creating the DLL, be sure to do it as a .NET Compact Framework project
so that the IDE still prevents you from using supported on the desktop but
not the device.
The only complication I've ever had with this approach is with having the
shared DLL call a webservice - the code generated for device projects to do
this doesn't work on the desktop.
--
Robert Levy
Program Manager
Mobile Devices Product Group
http://blogs.msdn.com/windowsmobile
This posting is provided "AS IS" with no warranties, and confers no
rights.
Stefan Hong wrote:
> I am working on an application that will work on PC, pocket PC and
> Smartphone. Obviously each platform must have it's own main Form
> design, but I want to share program logic between them as much as
> possible.
> I've searched the archive and found some ideas about using using
> multiple project files for the same set of source files, but manually
> maintain project file when adding/deleting source files is quite
> error-prone, especially when it is maintained by a group of people.
>
> Then I came up with an idea of creating an abstract class subclassing
> System.Windows.Forms.Form for shared code, then creates separate
> concrete class for each platform handling UI stuff. This sounds
> great, until I realized that I can't use the nice form designer in
> VS.net anymore. It only recognizes class subclassing from
> System.Windows.Forms.From directly.
>
> Is there any better idea to organize the project/code architecture?
>
>
> Thanks,
> Stefan