Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > dotnet compact framework > july 2003 >

dotnet compact framework : NETCFDESIGNTIME


Fette_Töle
7/31/2003 7:22:17 AM
I read in some tutorials=20
(http://smartdevices.microsoftdev.com/Learn/Articles/505.as
px) that you can use the compiler directive

#if NETCFDESIGNTIME
some code
#endif

in order to isolate code which is only necessary for the=20
GUI designer at design time. This means the designer=20
somehow assumes the NETCFDESIGNTIME constant to be defined=20
when it processes code.

However, this doesn't work for me, ie. the NETCFDESIGNTIME=20
constant seems to not to be existant. Is there a special=20
option to switch this constant on during design time?

Thanks for any help

fette T=F6le=20



Neil Enns [MSFT]
7/31/2003 7:32:33 AM
It took me a while to figure this out too, Fette. You actually have to add
this define yourself to the project options. In VS.NET open your project and
go to the Project > <Project> Properties menu item. In the Configuration
dropdown select "All Configurations". Click on the Configuration Properties
item in the left pane, then add NETCFDESIGNTIME to the "Conditional
Compilation Constants" option.

--
Neil Enns
Lead Program Manager
Microsoft Mobile Devices Product Group

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]
I read in some tutorials
(http://smartdevices.microsoftdev.com/Learn/Articles/505.as
px) that you can use the compiler directive

#if NETCFDESIGNTIME
some code
#endif

in order to isolate code which is only necessary for the
GUI designer at design time. This means the designer
somehow assumes the NETCFDESIGNTIME constant to be defined
when it processes code.

However, this doesn't work for me, ie. the NETCFDESIGNTIME
constant seems to not to be existant. Is there a special
option to switch this constant on during design time?

Thanks for any help

fette Töle




Fette_Töle
7/31/2003 8:02:45 AM
Thanks for your help.=20

The problem is that now not only the designer considers=20
the constants to be set but also the compiler during=20
normal builds. Consequently, i would have to remove the=20
constant from the project properties whenever i make a new=20
build. Not a very elegant solution ... I thought the=20
NETCFDESIGNTIME constant would only be taken into account=20
by the designer.

Fette T=F6le

[quoted text, click to view]
Chris Tacke, eMVP
7/31/2003 10:36:13 AM
It is defined simply in the batch files used for the command-line builds for
making the UI libraries. For all intents, Studio ignores everything inside
the #define.

--
Chris Tacke, eMVP
Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


[quoted text, click to view]
I read in some tutorials
(http://smartdevices.microsoftdev.com/Learn/Articles/505.as
px) that you can use the compiler directive

#if NETCFDESIGNTIME
some code
#endif

in order to isolate code which is only necessary for the
GUI designer at design time. This means the designer
somehow assumes the NETCFDESIGNTIME constant to be defined
when it processes code.

However, this doesn't work for me, ie. the NETCFDESIGNTIME
constant seems to not to be existant. Is there a special
option to switch this constant on during design time?

Thanks for any help

fette Töle




Paul G. Tobey [eMVP]
7/31/2003 11:36:16 AM
Then build separate projects for design-time and run-time.

Paul T.

[quoted text, click to view]
Thanks for your help.

The problem is that now not only the designer considers
the constants to be set but also the compiler during
normal builds. Consequently, i would have to remove the
constant from the project properties whenever i make a new
build. Not a very elegant solution ... I thought the
NETCFDESIGNTIME constant would only be taken into account
by the designer.

Fette Töle

[quoted text, click to view]

Fette_Töle
8/1/2003 1:11:17 AM
Makes sense. sorry for being a little bit dumb.

Fette T=F6le

[quoted text, click to view]
AddThis Social Bookmark Button