PC Review


Reply
Thread Tools Rate Thread

Conditional Compilation

 
 
ME
Guest
Posts: n/a
 
      19th May 2005
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


 
Reply With Quote
 
 
 
 
Daniel Moth
Guest
Posts: n/a
 
      19th May 2005
http://www.danielmoth.com/Blog/2004/...lframe_17.html
http://www.danielmoth.com/Blog/2004/...table-256.html

If you still have questions feel free to post back to the CF group

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"ME" <(E-Mail Removed)> wrote in message
news:4vGdnSJ74tu1PRHfRVn-(E-Mail Removed)...
>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
>


 
Reply With Quote
 
ME
Guest
Posts: n/a
 
      19th May 2005
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


"Daniel Moth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> http://www.danielmoth.com/Blog/2004/...lframe_17.html
> http://www.danielmoth.com/Blog/2004/...table-256.html
>
> If you still have questions feel free to post back to the CF group
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "ME" <(E-Mail Removed)> wrote in message
> news:4vGdnSJ74tu1PRHfRVn-(E-Mail Removed)...
>>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
>>

>



 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      19th May 2005
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
--
http://www.danielmoth.com/Blog/


"ME" <(E-Mail Removed)> wrote in message
news:6K-dnXFl2Mu5fRHfRVn-(E-Mail Removed)...
> 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
>
>
> "Daniel Moth" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> http://www.danielmoth.com/Blog/2004/...lframe_17.html
>> http://www.danielmoth.com/Blog/2004/...table-256.html
>>
>> If you still have questions feel free to post back to the CF group
>>
>> Cheers
>> Daniel
>> --
>> http://www.danielmoth.com/Blog/
>>
>>
>> "ME" <(E-Mail Removed)> wrote in message
>> news:4vGdnSJ74tu1PRHfRVn-(E-Mail Removed)...
>>>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
>>>

>>

>
>


 
Reply With Quote
 
Jim Cooper
Guest
Posts: n/a
 
      20th May 2005

> 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 Removed)
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Compilation ME Microsoft Dot NET 3 20th May 2005 09:34 AM
Conditional Compilation ME Microsoft Dot NET Framework 3 20th May 2005 09:34 AM
how to do conditional compilation in VB.NET? dee Microsoft Dot NET Framework 3 27th Mar 2005 05:59 AM
Conditional compilation? David Veeneman Microsoft C# .NET 3 2nd Feb 2005 01:19 PM
Conditional Compilation/Conditional Constants chris han Microsoft C# .NET 1 10th Jul 2003 09:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 AM.