Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxMDIChildFrame problem

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxMDIChildFrame problem
#2556
Posted by: 2003-08-25 22:36:08
When i click an event to open a new window, but, the program crashed, prompt me "Bugs report etc..".

then, the program will be force closing by window.

My testing evironment is on Window XP

void MyFrame::OnNewWindow(wxCommandEvent & WXUNUSED(event)) {

    MyChildWindow *subframe = new appChildWindow(frame, _T("Test New Window"),
                                    wxPoint(-1, -1), wxSize(-1, -1),
                                    wxDEFAULT_FRAME_STYLE);

    subframe->SetTitle("A");
    subframe->Show(TRUE);
}

could somebody tell me what happen?

Thank you.
Message2. Re: wxMDIChildFrame problem
#2571
Posted by: 2003-08-28 03:34:02
Looks like the problem is inside appChildWindow constructor. Can you post its code?
Message3. Re: wxMDIChildFrame problem
#2579
Posted by: 2003-08-30 20:17:34
hi, sorry, busy these few days.  You means, post whole source code?

Thank you.
Message4. Re: wxMDIChildFrame problem
#2604
Posted by: Ktirf 2003-09-06 21:55:31
The whole code of appChildWindow constructor.
Message5. Re: wxMDIChildFrame problem
#2619
Posted by: mooncake 2003-09-13 20:57:42
Hi, sorry for lately reply, becuase my computer is going down these few days...

below is my  appChildWindow constructor

class appChildWindow: public wxMDIChildFrame
{
public:
    appChildWindow(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
    ~appChildWindow();

};

thank you
Meow~
Message6. Re: wxMDIChildFrame problem
#2620
Posted by: Ktirf 2003-09-13 22:34:35
Now that's great :) I thought it was clear that the definition of the constructor is needed, not the declaration. I want to see, what does this constructor do.
Message7. Re: wxMDIChildFrame problem
#2621
Posted by: mooncake 2003-09-13 23:16:55
just want to create a child frame.

this child frame no have any event to be declare, just a simple child window

but, doing failed.. :(

Meow~
Message8. Re: wxMDIChildFrame problem
#2622
Posted by: Ktirf 2003-09-14 02:41:18
Could you please dump the body of the constructor, line by line! Ain't it so hard?
Like this:

appChildWindow::appChildWindow(/* ...... */) :
    wxMDIChildFrame(/* ..... */)
{
    // And so on
}

Most likely, the error is inside appChildWindow, but I'm not a magician to guess where exactly.

By the way - is MyFrame derived from wxMDIParentFrame?
Message9. Re: wxMDIChildFrame problem
#2623
Posted by: mooncake 2003-09-14 11:11:40
Hi, is that this one?


appChildWindow::appChildWindow(wxMDIParentFrame *parent, const wxString& title,
                 const wxPoint& pos, const wxSize& size,
                 const long style)
       : wxMDIChildFrame(parent, -1, title, pos, size,
                         style | wxNO_FULL_REPAINT_ON_RESIZE){
    my_children.Append(this);

    
    SetSizeHints(100, 100);
}

appChildWindow::~appChildWindow(){
    my_children.DeleteObject(this);
}

Meow~
Message10. Re: wxMDIChildFrame problem
#2625
Posted by: Ktirf 2003-09-14 15:34:31
Yes, that's it, great :)
But, unfortunately, the problem is still isn't clear :( Let's dig furhter.
Do I understand it right, that my_children is a wxList or wxObjArray object and it is global?
Message11. Re: wxMDIChildFrame problem
#2626
Posted by: mooncake 2003-09-14 16:52:28
my_children is wxList, global variable

Meow~
Message12. Re: wxMDIChildFrame problem
#2627
Posted by: Ktirf 2003-09-14 17:05:02
Next guess. Is 'frame' variable properly initialized before calling MyFrame::OnNewFrame? And, by the way, what is the class MyFrame derives from and what is the type of 'frame'? Is 'frame' just another name for 'this'?
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0