access violation when subscribing event
Posted: Sat Jun 24, 2006 06:13
by billconan
Unhandled exception at 0x0041231c in P.exe: 0xC0000005: Access violation reading location 0xbaadf008.
Code: Select all
bool allOver(const CEGUI::EventArgs& e)
{
exit(0);
return true;
}
Code: Select all
FrameWindow* theMainFrame=static_cast<FrameWindow*>(wmgr.createWindow("PolygonStudio/FrameWindow", "mainFrame"));
myRoot->addChildWindow(theMainFrame);
theMainFrame->subscribeEvent(FrameWindow::EventCloseClicked, &allOver);
Posted: Fri Jul 07, 2006 00:05
by enkd
Make sure that you built CEGUI against the same version of STL or STLport that your application uses. I had the same problem, access violation calling subscribeEvent.
My problem was that I built CEGUI against STL, and my application used STLport. As such, any CEGUI class which used standard library data members would be corrupted upon returing from CEGUI calls. For example, all was fine inside WindowManager::createWindow, but back in MY code, the Window was corrupted. This caused an invalid __vfptr (virtual function table pointer) and an access violation on the subscribeEvent call.
An easy check for this is to evaluate sizeof(CEGUI::EventSet) in the debugger, both when inside a CEGUI call and in your own code. The numbers shoud match. If not:
check your includes and rebuild CEGUI with STLport (if you use it)
also, be sure to include the preprocessor directive _STLP_DEBUG if you are using a debug build.
Posted: Fri Sep 01, 2006 17:26
by billconan
enkd wrote:Make sure that you built CEGUI against the same version of STL or STLport that your application uses. I had the same problem, access violation calling subscribeEvent.
My problem was that I built CEGUI against STL, and my application used STLport. As such, any CEGUI class which used standard library data members would be corrupted upon returing from CEGUI calls. For example, all was fine inside WindowManager::createWindow, but back in MY code, the Window was corrupted. This caused an invalid __vfptr (virtual function table pointer) and an access violation on the subscribeEvent call.
An easy check for this is to evaluate sizeof(CEGUI::EventSet) in the debugger, both when inside a CEGUI call and in your own code. The numbers shoud match. If not:
check your includes and rebuild CEGUI with STLport (if you use it)
also, be sure to include the preprocessor directive _STLP_DEBUG if you are using a debug build.
i did not build cegui myself, i downloaded the installer
Posted: Sat Sep 02, 2006 15:13
by CrazyEddie
On which line does the exception get thrown? Is it actually when subscribing or when the event is fired?
A full debug callstack at the point of the exception would be most useful
CE.
Posted: Sat Sep 02, 2006 19:15
by Das Gurke
Just recovered from
here and now having exactly the same issue
The whole app crashes here
Code: Select all
mGUISystem->injectMouseButtonUp((CEGUI::MouseButton)i);
but only if i subscribe to an event before. I am also using the CEGUI Version coming with Ogre 1.22.
Full Debug Callstack? How do I get one? Everything looking like "callstack" in the Visual Studio Express Debug IDE is
Code: Select all
> GSS - Projekt.exe!InputManager::injectToCeGUI() Line 21 + 0xe bytes C++
GSS - Projekt.exe!GsLogin::render() Line 60 C++
GSS - Projekt.exe!StateManager::render() Line 54 + 0x20 bytes C++
GSS - Projekt.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * hPrevInst=0x00000000, char * lpCmdLine=0x00151f13, int nCmdShow=1) Line 76 C++
GSS - Projekt.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
GSS - Projekt.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!7c816d4f()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
kernel32.dll!7c8399f3()