[Solved] Events, buttons etc...
Moderators: CEGUI MVP, CEGUI Team
Re: Events, buttons etc...
That was the message from before. You changed things in code since, please provide the exact error message in clear text as given in the output window if your IDE, and also post the callstack. I will look at it then.
Also did you make a breakpoint in the function and did you check the variable is alright before it is used?
Also did you make a breakpoint in the function and did you check the variable is alright before it is used?
CrazyEddie: "I don't like GUIs"
Re: Events, buttons etc...
When I read the link you sent to me I realized that my project was set on Release instead of Debug and now I guess it should work but it's worst, now it crashes when I create the whole GUI, the program is saying me that CEGUIBase-0.dll symbols were not loaded I don't know why...
This is the exception error:
And this is the code where it crashes at:
Finally this is the callstack output:
I don't know why CEGUIBase-0.dll were not loaded because I have it on my project folder, on window folder and sysWOW folder too. I'm sure this is the error I'm looking to fix.
This is the exception error:
Code: Select all
First-chance exception at 0x76E5C42D in Classic Engine.exe: Microsoft C++ exception: std::length_error at memory location 0x0018E564.
And this is the code where it crashes at:
Code: Select all
CEGUI::String ToString(float value)
{
return to_string(value);
}
Finally this is the callstack output:
Code: Select all
KernelBase.dll!_RaiseException@16() Unknown
[External Code]
CEGUIBase-0.dll!0f9bc24d() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for CEGUIBase-0.dll]
CEGUIBase-0.dll!0f8fee87() Unknown
CEGUIBase-0.dll!0f8f7159() Unknown
> Classic Engine.exe!ToString(float value) Line 18 C++
Classic Engine.exe!GUI_t::CLabel(CEGUI::String text, float x, float y, float sx, float sy, Color color, CEGUI::String font, CEGUI::String horzAlign, CEGUI::String vertAlign, CEGUI::Window * parent) Line 127 C++
Classic Engine.exe!InitGUI() Line 48 C++
Classic Engine.exe!initGL() Line 210 C++
Classic Engine.exe!main(int argc, char * * argv) Line 78 C++
[External Code]
I don't know why CEGUIBase-0.dll were not loaded because I have it on my project folder, on window folder and sysWOW folder too. I'm sure this is the error I'm looking to fix.
Re: Events, buttons etc...
CEGUIBase-0.dll got loaded, everything is fine. There are just no Debug symbols since you seem to having it built in Release mode. Rebuild in 'RelWithDebSymbols' mode if you need speed and the symbols. But for true debugging I would recommend plain 'Debug' mode. Please rebuild in either one of these modes and post the new callstack afterwards. Then we can help you better.
Re: Events, buttons etc...
Are you combining Debug with Release runtimes maybe? Please never do that.
CrazyEddie: "I don't like GUIs"
Re: Events, buttons etc...
I did it and here's the callstacks:
Exception:
Code: Select all
> Classic Engine.exe!Gridlist::OnClick(const CEGUI::EventArgs & args) Line 49 C++
Classic Engine.exe!CEGUI::MemberFunctionSlot<Gridlist>::operator()(const CEGUI::EventArgs & args) Line 55 C++
CEGUIBase-0.dll!58f891e2() Unknown
CEGUIBase-0.dll!58f8a814() Unknown
CEGUIBase-0.dll!58f8a7dc() Unknown
CEGUIBase-0.dll!58ff19ae() Unknown
CEGUIBase-0.dll!58ff19e7() Unknown
CEGUIBase-0.dll!58ff19e7() Unknown
CEGUIBase-0.dll!58f9a9fd() Unknown
Classic Engine.exe!glutMouseMotion(int button, int state, int x, int y) Line 578 C++
glut32.dll!004540f8() Unknown
glut32.dll!00453f6b() Unknown
glut32.dll!00452aa1() Unknown
[External Code]
glut32.dll!00445916() Unknown
glut32.dll!00445a64() Unknown
glut32.dll!00445861() Unknown
Classic Engine.exe!main(int argc, char * * argv) Line 81 C++
[External Code]
Exception:
Code: Select all
Unhandled exception at 0x58F0ED71 (CEGUIBase-0.dll) in Classic Engine.exe: 0xC0000005: Access violation reading location 0x00000390.
Re: Events, buttons etc...
What code is in the line shown by the error message?
Classic Engine.exe!Gridlist::OnClick(const CEGUI::EventArgs & args) Line 49 C++
Re: Events, buttons etc...
Code: Select all
bool OnClick(const CEGUI::EventArgs& args)
{
CEGUI::String ItemName = CListbox->getFirstSelectedItem()->getText();
cout << "Gridlist: " << CListbox << " - Clicked Item: " << ItemName << endl;
return true;
}
Re: Events, buttons etc...
That are 6 lines - I only need line 49.
Re: Events, buttons etc...
This is the line 49:
This is the line 43:
And this is the line 55:
Code: Select all
CEGUI::String ItemName = CListbox->getFirstSelectedItem()->getText();
This is the line 43:
Code: Select all
CListbox->addItem(static_cast<CEGUI::ItemEntry*>(item));
And this is the line 55:
Code: Select all
grid.AddItem("Item 1");
Re: Events, buttons etc...
What does getFirstSelectedItem() return? If it returns null getText() will crash your app since it tries to dereference a NULL pointer. Can you split line 49 so that you can check whether there is some valid pointer returned to you or not?
Re: Events, buttons etc...
I actually mentioned exactly this just some replies ago...
CrazyEddie: "I don't like GUIs"
Re: Events, buttons etc...
And I already answered you Ident. It returns NULL if I click on the RIGHT Listbox first, that's why it crashes my program. Obviously I did a IF condition to check if is NULL or not, and yes, it's NULL if I click RIGHT Listbox first.
Re: Events, buttons etc...
So in the case of the left listbox - what do you get? a not-null listbox? and you get an access violation then? Did you inspect the listbox with your debugger to see if it is a proper listbox instance? You need the debug symbols for this purpose as described.
CrazyEddie: "I don't like GUIs"
Re: Events, buttons etc...
Yes, If I click on the left one it gives me the output of the left listbox but not crashes of course, only crashes when I click right listbox first. If I click on left listbox it returns a valid listbox instance. How can I debug symbols as you said?
Re: Events, buttons etc...
What do you mean by "when I click right listbox first"? So if you catch the nullpointer you said it won't "crash" (as you call it)? So when does it crash and what do you get there as listbox then ..
CrazyEddie: "I don't like GUIs"
Who is online
Users browsing this forum: No registered users and 9 guests