I extended an event receive class which used to handle all keyboard and mouse events, with gui events.
I am talking about these 2 events:
Code: Select all
EGET_ELEMENT_FOCUSED
GET_ELEMENT_FOCUS_LOST
Unhandled exception at 0x00412609 in HandlingGuiEvents.exe: 0xC0000005: Access violation reading location 0x60500050.
And pointing to this line:
Code: Select all
callerID = event.GUIEvent.Caller->getID();
In this peace of code:
Code: Select all
case EGET_ELEMENT_FOCUSED:
{
callerID = event.GUIEvent.Caller->getID();
elementStatus[EGET_ELEMENT_FOCUSED] = TRUE;
break;
}
I know "callerID" is not causing this error because i have tested it like this:
Code: Select all
if(event.GUIEvent.Caller->getID() != 0)
callerID = event.GUIEvent.Caller->getID();
It crashed again pointing this time to the if statement line.
This is the callstack:
> HandlingGuiEvents.exe!CIrrEventReceiver::OnEvent(const irr::SEvent & event={...}) Line 300 + 0x12 bytes C++
Irrlicht.dll!100e02db()
[Frames below may be incorrect and/or missing, no symbols loaded for Irrlicht.dll]
Irrlicht.dll!100e09bf()
ntdll.dll!7c913212()
ntdll.dll!7c913281()
nvoglnt.dll!69725132()
ntdll.dll!7c926abe()
ntdll.dll!7c96cde9()
user32.dll!7e418724()
user32.dll!7e418806()
user32.dll!7e41c623()
user32.dll!7e41c649()
opengl32.dll!5ed2699b()
user32.dll!7e41ead2()
user32.dll!7e418724()
user32.dll!7e418806()
user32.dll!7e4189bd()
user32.dll!7e41c950()
user32.dll!7e41ca4b()
user32.dll!7e4196b7()
Irrlicht.dll!100e147d()
HandlingGuiEvents.exe!main(int argc=1, char * * argv=0x003a5fc0) Line 106 + 0x14 bytes C++
HandlingGuiEvents.exe!__tmainCRTStartup() Line 597 + 0x19 bytes C
HandlingGuiEvents.exe!mainCRTStartup() Line 414 C
kernel32.dll!7c816ff7()
And EGET_ELEMENT_FOCUS_LOST makes my app crash (sometimes) immediately and pointing to the same line:
Code: Select all
callerID = event.GUIEvent.Caller->getID();
By the way, this event:
Code: Select all
EGET_EDITBOX_ENTER
Made my app crash a few times too, even though i didn't had an editable box at that time yet.
Now that i do have a few editable boxes, it doesn't make it crash anymore.
I have tried fixing the bugs but i ended up overwriting the "messed up" files again.
Are these bugs or am i doing something wrong?