Conditional Compilation

M

ME

I would like to write a .NET Compact Framework App Simultaneously with a
standard .NET App using Conditional Compilation. However I have run into a
bit of, what I believe, a misunderstanding. How do you use condition
compilation options to specify which library, specifically
System.Windows.Forms, to use? It seems that I can have either one or the
other, but not both, conditionally, in the same project. Does anyone have
an example showing how to develop this kind of a project? What is the best
approach to develop the apps as close together as possible?

Thanks,

Matt
 
M

ME

Thanks Daniel,

That really put me on the right track. Don't know why I didn't think of
creating two seperate projects in the first place! However, after reading
your material, I noticed that you do not recommend using the process for
System.Windows.Forms (which I see and completely understand your reasoning).
I have a real need to do this against your recommendation though.

I am willing to take the time necessary to put the condition statements in
to make two versions of the same form in the same file, most (in my project)
will have the same fields give or take a few. There is one issue though
that I can't for the life of me figure out how to get around.

The designer creates a resource file for each form (.resx). Trouble is the
CF resouce file is not compatible with the Full Framework version and vise
versa. I thought of creating two different resource files per form and
directly editing the project file so that each platform's project uses an
independent resource file per form. This works. As long as I do not try to
open the form in the Designer! In fact I can compile just fine, but when I
open the form in the designer it generates a new resouce file with the
default name and I end up with two resouces files attached to my form. Any
one have any thoughts on how to overcome this?

Thanks,

Matt
 
D

Daniel Moth

If you insist on sharing form logic you are basically giving up on the
designer. There is no way round that as far as I know.

Cheers
Daniel
 
J

Jim Cooper

I have a real need to do this against your recommendation though.

Why? PDA apps will require a different UI than a PC application. You
can't really get away from this.

You can share business logic (even then you may be making a rod for your
own back), but you should definitely not share UI code. The controls are
different, the metaphors are different, the way the device itself is
used is different.

Cheers,
Jim Cooper

__________________________________________

Jim Cooper (e-mail address removed)
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top