NETCFDESIGNTIME

Discussion in 'Microsoft Dot NET Compact Framework' started by =?iso-8859-1?Q?Fette_T=F6le?=, Jul 31, 2003.

  1. 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
     
    =?iso-8859-1?Q?Fette_T=F6le?=, Jul 31, 2003
    #1
    1. Advertisements

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

    "Fette Töle" <> wrote in message
    news:004501c3576f$257be9d0$...
    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
     
    Neil Enns [MSFT], Jul 31, 2003
    #2
  3. 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


    "Fette Töle" <> wrote in message
    news:004501c3576f$257be9d0$...
    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
     
    Chris Tacke, eMVP, Jul 31, 2003
    #3
  4. 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

    >-----Original Message-----
    >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.
    >
    >"Fette Töle" <> wrote in message
    >news:004501c3576f$257be9d0$...
    >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
    >
    >
    >
    >
    >
    >.
    >
     
    =?iso-8859-1?Q?Fette_T=F6le?=, Jul 31, 2003
    #4
  5. Then build separate projects for design-time and run-time.

    Paul T.

    "Fette Töle" <> wrote in message
    news:0e2d01c35774$cc471820$...
    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

    >-----Original Message-----
    >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.
    >
    >"Fette Töle" <> wrote in message
    >news:004501c3576f$257be9d0$...
    >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], Jul 31, 2003
    #5
  6. Makes sense. sorry for being a little bit dumb.

    Fette Töle

    >-----Original Message-----
    >Then build separate projects for design-time and run-time.
    >
    >Paul T.
    >
    >"Fette Töle" <> wrote in message
    >news:0e2d01c35774$cc471820$...
    >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
    >
    >>-----Original Message-----
    >>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.
    >>
    >>"Fette Töle" <> wrote in message
    >>news:004501c3576f$257be9d0$...
    >>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
    >>
    >>
    >>
    >>
    >>
    >>.
    >>

    >
    >
    >.
    >
     
    =?iso-8859-1?Q?Fette_T=F6le?=, Aug 1, 2003
    #6

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page