wxPropertyGrid -> Append Crash Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
heyufool1
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jan 12, 2011 2:23 am

wxPropertyGrid -> Append Crash

Post by heyufool1 »

Hi! I have a property grid window made and put into an AUI manager. Now when I select an object on my screen (it's a level editor) I want the property grid to fill up with the selected object's properties. However when I try to do this using:

Code: Select all

g_ObjectProperties->Append(new wxIntProperty("X", "X Position", 0));
I get an "Unhandled exception at 0x00000000" error and it points to this method, at the closing bracket:

Code: Select all

wxPGProperty* wxPropertyGridPageState::DoAppend( wxPGProperty* property )
{
    wxPropertyCategory* cur_cat = m_currentCategory;
    if ( property->IsCategory() )
        cur_cat = NULL;

    return DoInsert( cur_cat, -1, property );
}
I tried using the Append method to add properties in the constructor of the object properties window and it works but not when I try to append it later on. Anyone else have as similar problem?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Can you show more context?

Make sure the g_ObjectProperties pointer is OK, a garbage pointer would be the most common cause for that kind of problems
"Keyboard not detected. Press F1 to continue"
-- Windows
heyufool1
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jan 12, 2011 2:23 am

Post by heyufool1 »

Make sure the g_ObjectProperties pointer is OK, a garbage pointer would be the most common cause for that kind of problems
Ah-HA! The problem was that I had an array declared with 3 indexes where in reality I wanted and used 4.

Code: Select all

OgreView* g_Views[3];
vs.

Code: Select all

OgreView* g_Views[4];
I thought that would give a fatal error or something if I tried to put data in a nonexistent index so I never caught it, but I found it now, changed it, and it works. :D All of this just because the array of windows unrelated to the ObjectProperties window was too small... Gotta love programming :P Thanks for your help!
Post Reply