f



Can't create window of class wxWindowClassNR (error 1406: cannot create a top-level child window.)

Hi,

I=E2=80=99ve tried to create a new wxFrame from another (I need to =
create a sub-window, or dialog of some sort). I inherited the wxFrame =
class into about (that=E2=80=99s the class name), and did an event table =
for it (just the close event).

After compiling, and I request for that dialog through a menu that I =
made, I get this message:

       11:53:35: Can't create window of class wxWindowClassNR (error =
1406: cannot create a top-level child window.)

The calling line is this:
	about* dialog =3D new about(NULL, ID_ABOUT_WINDOW, "About");

I=E2=80=99ve searched all round, but haven=E2=80=99t seemed to have =
found anything. Can anyone help? Or has anyone faced this problem =
before?

Best regards,
Joel Low

Windows XP/wxWidgets 2.5.4/MingW 3.4



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wx-users-help@lists.wxwidgets.org

0
joel
6/3/2005 4:03:39 AM
comp.soft-sys.wxwindows 21076 articles. 0 followers. Post Follow

2 Replies
2906 Views

Similar Articles

[PageSpeed] 5

Joel Low wrote:

>Hi,
>
>I’ve tried to create a new wxFrame from another (I need to create a sub-window, or dialog of some sort). I inherited the wxFrame class into about (that’s the class name), and did an event table for it (just the close event).
>
>After compiling, and I request for that dialog through a menu that I made, I get this message:
>
>       11:53:35: Can't create window of class wxWindowClassNR (error 1406: cannot create a top-level child window.)
>
>The calling line is this:
>	about* dialog = new about(NULL, ID_ABOUT_WINDOW, "About");
>
>I’ve searched all round, but haven’t seemed to have found anything. Can anyone help? Or has anyone faced this problem before?
>
>Best regards,
>Joel Low
>
>Windows XP/wxWidgets 2.5.4/MingW 3.4
>  
>
I encountered this today, for me it was that the parent wasn't created -
even though NULL should be fine, try it with a pointer to your main frame.

hope this is of some use
jake

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wx-users-help@lists.wxwidgets.org

0
jake
6/3/2005 4:15:17 AM
Joel Low schrieb:

>       11:53:35: Can't create window of class wxWindowClassNR (error 1406: cannot create a top-level child window.)
>  
>
This sounds like you forgot to override the following function:

    virtual bool IsTopLevel() const;

I guess that returning false should help ...

Regards,
Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wx-users-help@lists.wxwidgets.org

0
mjscod
6/3/2005 11:51:04 PM
Reply: