Having trouble with a guiButtonCtrl-related crash [Resolved]
by Andrew Swenson · in Torque Game Builder · 04/22/2009 (10:28 pm) · 0 replies
I'm not really sure what's causing this crash. I've narrowed it down to a function called by my gui button via the command property. the current code in the command field is:
.command = "%this.onClicked();";
I've tried the same code with an onClicked function that wasn't part of the class and a %this parameter, also with no success.
The function is called correctly, and the it runs through it fine, but it is crashing on the last bracket.
I ran TGB as a debug in visual studio, and at the point of the crash I get:
"Fatal: torquegamebuilder-1.7.4/engine/source/core/tvector.h @ 435" dialog with a:
"vector<T>::operator[] - out of bounds array access!"
error message in it.
Continuing on with it, in dynamicTypes.cc it seems to be trying to feed the array index of:
ConsoleBaseType *ConsoleBaseType::getType(const S32 typeID)
{
return gConsoleTypeTable[typeID];
}
with
typeID -825307442
Edit 2: It seems you cannot pass the button instance in a guiButtonCtrl's command field no matter how you do it. I couldn't use seperate functions, since the function called needed the instance. I ended up using mouse events, which is probably what I should have done initially.
.command = "%this.onClicked();";
I've tried the same code with an onClicked function that wasn't part of the class and a %this parameter, also with no success.
The function is called correctly, and the it runs through it fine, but it is crashing on the last bracket.
I ran TGB as a debug in visual studio, and at the point of the crash I get:
"Fatal: torquegamebuilder-1.7.4/engine/source/core/tvector.h @ 435" dialog with a:
"vector<T>::operator[] - out of bounds array access!"
error message in it.
Continuing on with it, in dynamicTypes.cc it seems to be trying to feed the array index of:
ConsoleBaseType *ConsoleBaseType::getType(const S32 typeID)
{
return gConsoleTypeTable[typeID];
}
with
typeID -825307442
Edit 2: It seems you cannot pass the button instance in a guiButtonCtrl's command field no matter how you do it. I couldn't use seperate functions, since the function called needed the instance. I ended up using mouse events, which is probably what I should have done initially.
About the author