Re: NullReferenceException on Frame creation

Kris Luyten <[email protected]> Sat, 28 Aug 2004 13:07:01 +0200
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
Hi Alexander,

thanks for your reply! You cansee my answer below.

On Sat, 28 Aug 2004 10:41:18 +0200, Alexander Olk
<[email protected]> wrote:
> Am Sa, den 28.08.2004 schrieb Kris Luyten um 1:05:
> > Has anyone an idea what can cause the NullReferenceException in the
> > Frame constructor?
> 
> App.OnInit gets called right after programm start (that means, right
> after the initialization of the wxWidgets library). Your OnInit member
> only calls m_topFrame.Show(true) but doesn't create a new instance of
> ContainerFrame. So, m_topFrame is null and that causes a
> NullReferenceException...

This did work before by the way; I did not had a
NullReferenceException with the same code when I used Wx.Net 3.0. (I
even have screenshots to prove it (-; )

Since m_topFrame is created in the constructor of the
WxRenderedInstance class (WxRenderedInstance inherits from App), I
find this somewhat confusing. This would mean OnInit is called before
the constructor in the same class is?


Regards,
Kris


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click