Board index » cppbuilder » How can the code know if I want run/design time package

How can the code know if I want run/design time package

Hi

In my package I use a macro to include/exclude code when I compile eigther
run or design time version of the package. So when I switch between the 2
version I just have to change one line of code.
But is there a way to get the code to read if I have selected
runtime/designtime only in project options, so that don't have to make any
changes to the code??

Thanks
Torben Laursen

 

Re:How can the code know if I want run/design time package


You can't read the Project Options themselves.  What you can do, however, is
simply add your own custom conditional to the Conditionals list of the
Project Options for one of the projects, such as the design-time package,
and then have your code test for the existance of that conditional when
compiling, ie:

    #ifdef COMPILING_DESIGNTIME
        // do something
    #endif

Gambit

Quote
"Torben Laursen" <does...@work.com> wrote in message

news:3e17919b@newsgroups.borland.com...
Quote
> In my package I use a macro to include/exclude code when
> I compile eigther run or design time version of the package. So
> when I switch between the 2 version I just have to change one
> line of code. But is there a way to get the code to read if I have
> selected runtime/designtime only in project options, so that
> don't have to make any changes to the code??

Other Threads