User forums > General (but related to Code::Blocks)

const wxString

<< < (3/3)

thomas:
Sam is right as far as the problem is concerned. It is a problem of order of initialisation.
But his solution is not good, the variable does not belong into app.cpp oops... appglobals.cpp.

mandrav:

--- Quote from: 280Z28 on January 24, 2006, 05:34:30 am ---Move it to appglobals.cpp

--- End quote ---

See Sam? That's what I was talking about in our PM conversation the other day...

sethjackson, Sam got it right: it's a global creation order problem.
But for heaven's sake don't move it to appglobals!   :shock:
Just move it inside the function where it is used. IIRC it's only used in the constructor.

280Z28:
I renamed it to APP_DESC when I moved it. It seemed reasonable to say that's the description of Code::Blocks, and I put an extern blah blah in appglobals.h.

I'd say it's as relevant in the global scope as APP_NAME is, plus you don't have to worry about going to find it in some dialog code when it's more relevant to the app than it is to that specific dialog. I stand that it should go in appglobals.h/cpp :)

sethjackson:

--- Quote from: mandrav on January 24, 2006, 08:39:40 am ---
--- Quote from: 280Z28 on January 24, 2006, 05:34:30 am ---Move it to appglobals.cpp

--- End quote ---

See Sam? That's what I was talking about in our PM conversation the other day...

sethjackson, Sam got it right: it's a global creation order problem.
But for heaven's sake don't move it to appglobals!   :shock:
Just move it inside the function where it is used. IIRC it's only used in the constructor.

--- End quote ---

Yeah I won't. I got a PM from thomas about this (sort of)..... I will start coding after lunch.  :D

Navigation

[0] Message Index

[*] Previous page

Go to full version