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

