Sharing code with a desktop application

  • Thread starter Thread starter Roy Chastain
  • Start date Start date
R

Roy Chastain

I am writing a small application that I would like to run on both a desktop system and a Pocket PC. The heart of the application can be
made into a control that can be displayed on the main form of the respective applications.

I have discovered that this is not a simple as it sounded. I created a solution with 3 projects.
Desktop Main project
Mobile Main project
Common Control

As it turns out the Common Control compiles for the Desktop app and run, but will not compile for the Mobile app. References to System.Byte
are a problem, even though I don't have any in my code.

Does anyone have any words of wisdom on how to share source code between Mobile and Desktop apps?

Thanks
 
The general rule is that you separate a portable part of your code into a
Smart Device (not desktop!) Library project and then use this in both device
and desktop projects. This is because smartdevice projects use retargetable
assembly references and can be used on the desktop. The opposite is not true

--
Alex Feinman
---
Visit http://www.opennetcf.org
Roy Chastain said:
I am writing a small application that I would like to run on both a
desktop system and a Pocket PC. The heart of the application can be
made into a control that can be displayed on the main form of the respective applications.

I have discovered that this is not a simple as it sounded. I created a solution with 3 projects.
Desktop Main project
Mobile Main project
Common Control

As it turns out the Common Control compiles for the Desktop app and run,
but will not compile for the Mobile app. References to System.Byte
 
I don't have 'Smart Device Library' project type to chose from. Am I missing something in VS or do I have to do some game playing to make
it work?

Thanks
 
Please disregard previous post. I see that it is a choice on the next screen of the Smart Device Application wizard. Duh!

Thanks for pointing me in the right direction.
 
Choose Smart Device Project and then when prompted select Class Library (as
opposite to Windows Application or Non-graphical app)

--
Alex Feinman
---
Visit http://www.opennetcf.org
Roy Chastain said:
I don't have 'Smart Device Library' project type to chose from. Am I
missing something in VS or do I have to do some game playing to make
it work?

Thanks
 
Back
Top