Board index » cppbuilder » static class members

static class members

Hi,

I have some classes which contain static members which I initialise in the
global namespace.  This works fine when  I am developing a console .exe.
But when I try to use the same class in the same way under a Windows
application the static members are not properly initialised.  Is there a way
to solve this?

Thanks,

Nokome

 

Re:static class members


We need more information.  For example, please explain what you mean by
"...are not properly initializsed."  Can you show actual code (a minimal
code example) that reproduces this problem?

Right now there just isn't enough to go by to offer any advice at all.
Well, one thing you can check is if the constructor of one static object
depends on another class's static data object.  The order of construction of
static objects that exist in different files is unspecified,so it's unsafe
to ever depend on creation order of static objects between files.  (If
they're in the same file, then the order of creation is the order of
declaration.)

Other than that, I would have to see the code before I can really help.
Sorry.

Chris (TeamB)

Quote
Nokome Bentley wrote in message <39001370@dnews>...
>Hi,

>I have some classes which contain static members which I initialise in the
>global namespace.  This works fine when  I am developing a console .exe.
>But when I try to use the same class in the same way under a Windows
>application the static members are not properly initialised.  Is there a
way
>to solve this?

>Thanks,

>Nokome

Other Threads