[SOLVED] Run-Time Check Failure #0 calling GUIEvent.caller

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
NetKing
Posts: 6
Joined: Mon Aug 01, 2011 4:42 am

[SOLVED] Run-Time Check Failure #0 calling GUIEvent.caller

Post by NetKing »

Hi again,
I'm trying to compile this code:

Code: Select all

IGUITreeViewNode *n = (IGUITreeViewNode *)evt.GUIEvent.Caller;
Tag *c = (Tag *)n->getData();
 
from within an OnEvent(SEvent &evt) function, and I'm getting a Run-Time Check Failure #0 error at the point where it calls getData().

Any tips or solutions?
Thanks a lot.

-- Edit --
I checked the API a bit and realized that IGUITreeViewNode is not actually an IGUIElement, so I have to use IGUITreeView::getLastEventNode() to get the pointer to the event node.
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: [SOLVED] Run-Time Check Failure #0 calling GUIEvent.call

Post by gerdb »

maybe check, if n is valid

IGUITreeViewNode *n = (IGUITreeViewNode *)evt.GUIEvent.Caller;
Tag* c = NULL;
if (n)
c = (Tag*)n->getData();
if (c)
// ... use it
Post Reply