Access violation when attaching a child window

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

naxi
Just popping in
Just popping in
Posts: 1
Joined: Wed Aug 21, 2013 09:46

Access violation when attaching a child window

Postby naxi » Wed Aug 21, 2013 10:09

"Unhandled exception at 0x03253e52 in CEGUITest.exe: 0xC0000005: Access violation reading location 0x00000010." is the error message I get when I try to attach a child window to the root window. (the error doesn't actually appear on that line, see below)
I'm using CEGUI 0.8.2 along with Ogre 1.9 and Visual Studio 2010

Could it be that I failed to compile CEGUI correctly? I wouldn't be surprised, since I'm still new to C++ and all its compiling/linking mess :P (And I don't find any tutorials on this site terribly useful either.)
CMake didn't find most of the dependencies (if any, not sure), but I changed my solution file and added the additional directories myself...

the error happens here: cegui/src/RenderModules/Ogre/RenderTarget.inl in line 134 when Ogre is rendering a frame

Code: Select all

d_renderSystem._setViewport(d_viewport);

I set a breakpoint at that line I saw that it crashes the second time. I suppose the first time is the root window, while the second one is the child window (since the width/height in the debugger change)


Code: Select all

   // create ogre renderer
   CEGUI::OgreRenderer& myRenderer =
      CEGUI::OgreRenderer::create(*mWindow);

   // create ogre resource provider and pass it to the system creation, so that CEGUI uses Ogre's resources
   CEGUI::OgreResourceProvider &resourceProvider = myRenderer.createOgreResourceProvider();
   CEGUI::System::create( myRenderer , &resourceProvider );

   // set the default resource groups to be used
   CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
   CEGUI::Font::setDefaultResourceGroup("fonts");
   CEGUI::Scheme::setDefaultResourceGroup("schemes");
   CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeel");
   CEGUI::WindowManager::setDefaultResourceGroup("layouts");
   CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");

   // setup default group for validation schemas
   CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
   if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
      parser->setProperty("SchemaDefaultResourceGroup", "schemas");

   CEGUI::GUIContext* context = &CEGUI::System::getSingleton().getDefaultGUIContext();
   CEGUI::SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
   context->getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
   CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
   CEGUI::Window* d_root = (CEGUI::DefaultWindow*)winMgr.createWindow("DefaultWindow", "Root");
   CEGUI::Font& defaultFont = CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-12.font");
   context->setDefaultFont(&defaultFont);
   context->setRootWindow(d_root);

   //if I comment this out, I get a window with just the mouse cursor. That's working fine
   CEGUI::FrameWindow* wnd = (CEGUI::FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window");
   d_root->addChild(wnd);


Code: Select all

21/08/2013 11:47:56 (Std)    ********************************************************************************
21/08/2013 11:47:56 (Std)    ********************************************************************************
21/08/2013 11:47:56 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
21/08/2013 11:47:56 (Std)    ********************************************************************************
21/08/2013 11:47:56 (Std)    ---- Version: 0.8.2 (Build: Aug 21 2013 Debug Microsoft Windows MSVC++ 10.0 32 bit) ----
21/08/2013 11:47:56 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
21/08/2013 11:47:56 (Std)    ---- XML Parser module is: CEGUI::RapidXMLParser - Official RapidXML based parser module for CEGUI ----
21/08/2013 11:47:56 (Std)    ---- Image Codec module is: STBImageCodec - stb_image.c based image codec ----
21/08/2013 11:47:56 (Std)    ---- Scripting module is: None ----
21/08/2013 11:47:56 (Std)    ********************************************************************************
21/08/2013 11:47:56 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
21/08/2013 11:47:56 (Std)    ********************************************************************************



Thank you very much in advance!

Return to “Help”

Who is online

Users browsing this forum: No registered users and 1 guest