CEGUI run-time error with setText()

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
geminito
Just popping in
Just popping in
Posts: 7
Joined: Mon Nov 07, 2005 01:18
Location: Toronto

CEGUI run-time error with setText()

Postby geminito » Tue Nov 08, 2005 03:08

Hello CEGUI folks. I'm so glad this project exists. :)

I have posted this problem on the OGRE Help forum, so I appologize if this is a case of "cross-posting". I don't think the OGRE forum was the best place for this question. Here goes.

I'm a bit stuck with a "Run-time error!" message while running my ogre+cegui app. I've got a CEGUI::MultiLineEditbox that I am popping up for users to enter text into.

Before popping up the editbox, I use setText() to initialize it with some text that the user can edit and save. Something like this:

mpEditorBox->setText( pszText );

For about 5 to 10 times, this works fine. But then a run-time error occurs, with a stack like this:


kernel32.dll!77e738b2()
kernel32.dll!77e738b2()
> msvcp71.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize=3765269347, unsigned int _Oldlen=1) Line 1470 C++
msvcr71.dll!_CxxThrowException(void * pExceptionObject=0x0012f754, const _s__ThrowInfo * pThrowInfo=0x006a8aa8) + 0x34 C++
CEGUIBase.dll!005c8a9d()
ntdll.dll!77f6379e()
ntdll.dll!77f635c7()
CEGUIBase.dll!005ebb83()
CEGUIBase.dll!0061c2f7()
ntdll.dll!77f83bb5()
msvcr71.dll!_heap_alloc(unsigned int size=304566292) Line 212 + 0x5 C
CEGUIBase.dll!005c678f()
CEGUIBase.dll!005c6120()
CEGUIBase.dll!0061c741()
CEGUIBase.dll!005ed233()
CEGUIBase.dll!0061ddce()
CEGUIBase.dll!005ef7f5()
MudMapper2.exe!ZonesEditorState::handleEDIT(const CEGUI::EventArgs & e={...}) Line 1062 + 0x2a C++
MudMapper2.exe!CEGUI::_memberBinder<MapperContextWindow,bool,CEGUI::EventArgs const &>::operator()(const CEGUI::EventArgs & args={...}) Line 103 C++
CEGUIBase.dll!005cacf2()
CEGUIBase.dll!005cbb42()
CEGUIBase.dll!005edfe6()
CEGUIBase.dll!005eeea5()
CEGUIBase.dll!005edfe6()
CEGUIBase.dll!005eee6d()
CEGUIBase.dll!005eeea5()
CEGUIBase.dll!005ef6f7()
CEGUIBase.dll!005f4573()
CEGUIBase.dll!005ebd7b()
CEGUIBase.dll!005ef777()
CEGUIBase.dll!005ef76a()
CEGUIBase.dll!005ef76a()
CEGUIBase.dll!0061f788()
CEGUIBase.dll!0061f802()
CEGUIBase.dll!005e90ae()
MudMapper2.exe!ZonesEditorState::mouseReleased(Ogre::MouseEvent * e=0x0f6195f0) Line 426 + 0x21 C++
MudMapper2.exe!MapperStateManager::mouseReleased(Ogre::MouseEvent * e=0x0f6195f0) Line 140 C++
MudMapper2.exe!MapperListener::mouseReleased(Ogre::MouseEvent * e=0x0f6195f0) Line 97 C++
OgreMain.dll!1008d5f5()
OgreMain.dll!10047675()
OgreMain.dll!100472f1()
OgreMain.dll!100ca36f()
OgreMain.dll!100ca7dc()
OgreMain.dll!100ca7ec()
OgreMain.dll!100cacde()
MudMapper2.exe!ExampleApplication::go() Line 61 C++
MudMapper2.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00141f14, HINSTANCE__ * __formal=0x00000000) Line 309 + 0x8 C++
MudMapper2.exe!WinMainCRTStartup() Line 390 + 0x1b C
kernel32.dll!77e8141a()



I have tried disabling Ogre's memory manager. I am also now using the mysterious CEGUI_fix.h header file instead of including CEGUI.h everywhere. This file is documented in the OGRE wiki. Not documented well, but it's there.

I am using the latest OGRE SDK. I'm not compiling OGRE or CEGUI myself. So, CEGUI is version 0.3.0 (I believe). The libraries included are:
OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib
These are from the usual D:\OgreSDK\lib location.

Any suggestions on how I should debug and resolve this problem? Clues? Thoughts? Anecdotes?

Cheers!
Neil

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: CEGUI run-time error with setText()

Postby martignasse » Tue Nov 08, 2005 18:25

kernel32.dll!77e738b2()
kernel32.dll!77e738b2()
> msvcp71.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize=3765269347, unsigned int _Oldlen=1) Line 1470 C++
msvcr71.dll!_CxxThrowException(void * pExceptionObject=0x0012f754, const _s__ThrowInfo * pThrowInfo=0x006a8aa8 ) + 0x34 C++
CEGUIBase.dll!005c8a9d()
ntdll.dll!77f6379e()
ntdll.dll!77f635c7()
maybe a problem when the setText() fonction try to copy the text you provide to the text attribut of the EditBox.
Have you checked you'r "pszText" initialisation and lifetime ?

can't help more :(

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI run-time error with setText()

Postby CrazyEddie » Tue Nov 08, 2005 19:49

I think you are seeing a bug that existed in the 0.3.0 release; the bug was fixed back in August. In order to rectify the issue you will need to update to a later version of the code, which means compiling CEGUI yourself, and possibly also re-compiling the Ogre CEGUI renderer module against the later CEGUI headers and libs.

If you want to stay with 0.3.0 and download the source package for that, you will need to do a cvs update (or checkout the v0-3 branch) to get the required fixes.

The 0.4.0 release source package contains this fix, so you might prefer that - especially due to all the new things added and other bugs fixed since 0.3.0. Though there have also been further bugs fixed since the 0.4.0 release, and a 'cvs update' is advised on this also (or just get the v0-4 branch).

A 0.4.1 release will likely be made sometime later this year.

It is currently strongly recommended that you do NOT use the cvs head version of the code ;)

CE.

User avatar
geminito
Just popping in
Just popping in
Posts: 7
Joined: Mon Nov 07, 2005 01:18
Location: Toronto

Re: CEGUI run-time error with setText()

Postby geminito » Tue Nov 15, 2005 05:11

Thanks alot, CE!

I am currently compiling the latest stable OGRE code and will give CEGUI 0.4.0 a try. I read what is in 0.4.0, and definitely wanted to use it, so this was on my to-do list anyway.

Cheers!

User avatar
geminito
Just popping in
Just popping in
Posts: 7
Joined: Mon Nov 07, 2005 01:18
Location: Toronto

Re: CEGUI run-time error with setText()

Postby geminito » Sun Nov 20, 2005 21:02

FYI,

0.4.0 does fix the abend in setText described above.

Cheers!
Neil


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 14 guests