NETCFDESIGNTIME

  • Thread starter Thread starter =?iso-8859-1?Q?Fette_T=F6le?=
  • Start date Start date
?

=?iso-8859-1?Q?Fette_T=F6le?=

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
 
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.

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
 
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


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
 
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
 
Then build separate projects for design-time and run-time.

Paul T.

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
 
Back
Top