Adding a new variable in Class is creating problem.(making parent Null)

S

sharat

Hi,

I am facing a strange problem.
I am working with already implemented very big code of project in C++.

Its related to GUI function.

I have added a new button to a dialog and its functionality.
Everything works fine if I declare the local variable in Class
constructor. but I observed if I declare any variable in .h file
inside a class definition then its making the parent window's
pointer's(look up on parent) NULL. I am not getting that declaring
variable in class deification , how it is creating problem?

is this related to some inheritance already defined design patterns or
anything else, might be a small problem.

Please help.
thanks in advance.
 
N

Nick Keighley

Hi,

I am facing a strange problem.
I am working with already implemented very big code of project in C++.

Its related to GUI function.

I have added a new button to a dialog and its functionality.
Everything works fine if I declare the local variable in Class
constructor. but I observed if I declare any variable in .h file
inside a class definition then its making the parent window's
pointer's(look up on parent) NULL. I am not getting that declaring
variable in class deification , how it is creating problem?

is this related to some inheritance already defined design patterns or
anything else, might be a small problem.

can you post a short example that illustrates your problem?
 
S

sharat

can you post a short example that illustrates your problem?

Thanks!! But My problem got solve.

I have declared the variable after declaration of parent window
pointer. and it works!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top