Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Adding a new variable in Class is creating problem.(making parent Null)

Reply
Thread Tools

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

 
 
sharat
Guest
Posts: n/a
 
      02-17-2012
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.
 
Reply With Quote
 
 
 
 
Nick Keighley
Guest
Posts: n/a
 
      02-17-2012
On Feb 17, 8:13*am, sharat <(E-Mail Removed)> wrote:
> 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?
 
Reply With Quote
 
 
 
 
sharat
Guest
Posts: n/a
 
      02-17-2012
On Feb 17, 2:48*pm, Nick Keighley <(E-Mail Removed)>
wrote:
> On Feb 17, 8:13*am, sharat <(E-Mail Removed)> wrote:
>
>
>
>
>
>
>
>
>
> > 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?


Thanks!! But My problem got solve.

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
adding new parent element by matching child attribute value madmaler@googlemail.com XML 1 02-19-2008 11:37 AM
Setting class variable from parent class? Marco Ruby 4 04-03-2006 11:44 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
creating instance of parent class ? mhk Java 1 12-02-2003 03:38 AM



Advertisments