Unhandled execption on System::create()
Moderators: CEGUI MVP, CEGUI Team
Unhandled execption on System::create()
So I'm getting:
Unhandled exception at 0x7c812afb in CEGUITest-Debug.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x0013ef88..
OpenGLRenderer& renderer = OpenGLRenderer::create();
System::create(renderer); // this line gives error. renderer is a valid object
What library is this in? I know this is a very generic error so not sure if anyone has any ideas.
Unhandled exception at 0x7c812afb in CEGUITest-Debug.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x0013ef88..
OpenGLRenderer& renderer = OpenGLRenderer::create();
System::create(renderer); // this line gives error. renderer is a valid object
What library is this in? I know this is a very generic error so not sure if anyone has any ideas.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Unhandled execption on System::create()
Hi,
You should use try/catch blocks around your code so you can output the message from the exception to discover why the exception was thrown.
In this case I'm going to tell you that it's because the XML parser or Image Codec DLL can't be found- so for the default builds CEGUIExpatParser and CEGUISILLYImageCodec + SILLY dlls (or the _d suffixed versions for debug builds) need to be in the working directory. Note also that the MSVC++ debugger working directory defaults to a location other than where the executable resides.
CE.
You should use try/catch blocks around your code so you can output the message from the exception to discover why the exception was thrown.
In this case I'm going to tell you that it's because the XML parser or Image Codec DLL can't be found- so for the default builds CEGUIExpatParser and CEGUISILLYImageCodec + SILLY dlls (or the _d suffixed versions for debug builds) need to be in the working directory. Note also that the MSVC++ debugger working directory defaults to a location other than where the executable resides.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Unhandled execption on System::create()
Thank you again. I assume you knew what I was missing because of my other post 
I actually setup my project so the main exe is put at the root directory of my project to make things like this easier. It's also how the graphics library I use sets up their projects since they require a few dependencies.
Thanks again Crazy. You are probably one of the most helpful authors of software out there. Very respectful to newbies also
I'm hoping to get this working with Leadwerks Engine, which uses OpenGL.
Note also that the MSVC++ debugger working directory defaults to a location other than where the executable resides.
I actually setup my project so the main exe is put at the root directory of my project to make things like this easier. It's also how the graphics library I use sets up their projects since they require a few dependencies.
Thanks again Crazy. You are probably one of the most helpful authors of software out there. Very respectful to newbies also
I'm hoping to get this working with Leadwerks Engine, which uses OpenGL.
Re: Unhandled execption on System::create()
What object should we use for these exceptions?
I tried CEGUI::Exception but it didn't seem to return anything for this exception that is being thrown at the following line:
FrameWindow* fWnd = reinterpret_cast<FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "testWindow"));
Any ideas? I copied the datafiles to the directory where my exe is (the root in my case), but got the same error.
I tried CEGUI::Exception but it didn't seem to return anything for this exception that is being thrown at the following line:
FrameWindow* fWnd = reinterpret_cast<FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "testWindow"));
Any ideas? I copied the datafiles to the directory where my exe is (the root in my case), but got the same error.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Unhandled execption on System::create()
In 0.7.x you can use CEGUI::Exception or std::exception. I'm not sure what the issue might be here, what's the exact type of exception that's being thrown (according to the debugger)?
A wild guess might be that you didn't load the TaharezLook.scheme? Are you following the tutorials, or...?
CE.
A wild guess might be that you didn't load the TaharezLook.scheme? Are you following the tutorials, or...?
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Unhandled execption on System::create()
It's an UnknownObjectException that's being thrown.
I'm following http://www.cegui.org.uk/docs/current/wi ... orial.html tutorial but I don't see anything about loading a scheme. I assume it's http://www.cegui.org.uk/docs/current/da ... orial.html. Where do I put this stuff? I assume after I created the renderer and before I create a window?
It seems the tutorials are kind of scattered source chuncks. It would be really helpful to show a very small source example of getting a basic window with a button up. All the includes needed (I've been able to figure most out, but it's a trial and error method on my part with following the tutorials and finding a header file that's named the same as the class because the tutorials don't seem to tell you what header files are needed). I can understand the difficultly in making tutorials since people could be using any rendering engine, but I would think a basic example with maybe just comments where the engine specific stuff would go. Seeing the order of the CEGUI function calling and the includes I think would be pretty handy.
There are so many options for CEGUI and many different ways to do something that it's a little confusing to me right at the moment.
So here is my small little chunk of code. Getting an error with SchemeManager. Does the SchemeManager class look in thte datafiles/schemes folder by default or do I need to either add the path to the function parameter or move the scheme file outside of the datafiles/schemes and at the root exe level?
I'm following http://www.cegui.org.uk/docs/current/wi ... orial.html tutorial but I don't see anything about loading a scheme. I assume it's http://www.cegui.org.uk/docs/current/da ... orial.html. Where do I put this stuff? I assume after I created the renderer and before I create a window?
It seems the tutorials are kind of scattered source chuncks. It would be really helpful to show a very small source example of getting a basic window with a button up. All the includes needed (I've been able to figure most out, but it's a trial and error method on my part with following the tutorials and finding a header file that's named the same as the class because the tutorials don't seem to tell you what header files are needed). I can understand the difficultly in making tutorials since people could be using any rendering engine, but I would think a basic example with maybe just comments where the engine specific stuff would go. Seeing the order of the CEGUI function calling and the includes I think would be pretty handy.
There are so many options for CEGUI and many different ways to do something that it's a little confusing to me right at the moment.
So here is my small little chunk of code. Getting an error with SchemeManager. Does the SchemeManager class look in thte datafiles/schemes folder by default or do I need to either add the path to the function parameter or move the scheme file outside of the datafiles/schemes and at the root exe level?
Code: Select all
try
{
OpenGLRenderer& renderer = OpenGLRenderer::create();
System::create(renderer);
}
catch(CEGUI::Exception e)
{
}
SchemeManager::getSingleton().create("TaharezLook.scheme"); // This is giving an error of InvalidRequestException
WindowManager& wmgr = WindowManager::getSingleton();
Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
System::getSingleton().setGUISheet(myRoot);
FrameWindow* fWnd = reinterpret_cast<FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "testWindow"));
myRoot->addChildWindow(myRoot);
fWnd->setPosition( UVector2( UDim( 0.25f, 0 ), UDim( 0.25f, 0 ) ) );
fWnd->setSize( UVector2( UDim( 0.5f, 0 ), UDim( 0.5f, 0 ) ) );
fWnd->setText( "Hello World!" );
Re: Unhandled execption on System::create()
OK, here is my new code after checking out tutorials 1-4 I think.
At line SchemeManager::getSingleton().create("TaharezLook.scheme"); I'm getting InvalidRequestException thrown. Any ideas?
At line SchemeManager::getSingleton().create("TaharezLook.scheme"); I'm getting InvalidRequestException thrown. Any ideas?
Code: Select all
try
{
OpenGLRenderer& renderer = OpenGLRenderer::create();
System::create(renderer);
}
catch(CEGUI::Exception e)
{
}
// initialise the required dirs for the DefaultResourceProvider
DefaultResourceProvider* rp = static_cast<DefaultResourceProvider*>
(System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "../datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "../datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "../datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "../datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "../datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "../datafiles/lua_scripts/");
// This is only needed if you are using Xerces and need to
// specify the schemas location
rp->setResourceGroupDirectory("schemas", "../../XMLRefSchema/");
// set the default resource groups to be used
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// Again, you only need to this one if you are using xerces and have
// defined a group for schemas.
CEGUI::XercesParser::setSchemaDefaultResourceGroup("schemas");
SchemeManager::getSingleton().create("TaharezLook.scheme");
WindowManager& wmgr = WindowManager::getSingleton();
Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
System::getSingleton().setGUISheet(myRoot);
//FrameWindow* fWnd = reinterpret_cast<FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "testWindow"));
Window* fWnd = wmgr.createWindow("TaharezLook/FrameWindow", "testWindow");
myRoot->addChildWindow(myRoot);
fWnd->setPosition( UVector2( UDim( 0.25f, 0 ), UDim( 0.25f, 0 ) ) );
fWnd->setSize( UVector2( UDim( 0.5f, 0 ), UDim( 0.5f, 0 ) ) );
fWnd->setText( "Hello World!" );
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Unhandled execption on System::create()
What does the CEGUI.log file say?
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Unhandled execption on System::create()
Ah I didn't even notice that log
So it seems it can't find that scheme. I have the 'datafiles' dir and everything under it at my root level which is where I have the exe conifgured to go also. Do I need to take stuff out of the 'datafiles' dir or does the underlying code automatically look inside this dir?
DefaultResourceProvider::load - TaharezLook.scheme does not exist
So it seems it can't find that scheme. I have the 'datafiles' dir and everything under it at my root level which is where I have the exe conifgured to go also. Do I need to take stuff out of the 'datafiles' dir or does the underlying code automatically look inside this dir?
Re: Unhandled execption on System::create()
Oh I think I see that you are expecting the datafiles dir to be up a dir from the exe. So I removed the .. from those paths. I wasn't sure about rp->setResourceGroupDirectory("schemas", "../../XMLRefSchema/"); I couldn't seem to find that XMLRefSchema dir anywhere so I left it, but got the same error.
Re: Unhandled execption on System::create()
OK, I got past the errors.
This
rp->setResourceGroupDirectory("schemas", "../../XMLRefSchema/");
Needed to be this
rp->setResourceGroupDirectory("schemas", "datafiles/xml_schemas/");
And I needed to remove the prefix of '/' from my resource groups.
So now I don't get any errors but I don't see anything on screen. I'll probably have to do some OpenGL stuff since this engine hides all that.
This
rp->setResourceGroupDirectory("schemas", "../../XMLRefSchema/");
Needed to be this
rp->setResourceGroupDirectory("schemas", "datafiles/xml_schemas/");
And I needed to remove the prefix of '/' from my resource groups.
So now I don't get any errors but I don't see anything on screen. I'll probably have to do some OpenGL stuff since this engine hides all that.
Re: Unhandled execption on System::create()
Sweet! Got it working. Thanks for your help CE. This is exciting.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Unhandled execption on System::create()
It's good you have it working. It seems there was some confusion over the 'old' location of the XML schemas, and the new location. In general for 0.7.x code, currently the main docs are the only source of reliable information - most of the Wiki for example is still geared towards the previous versions.
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Unhandled execption on System::create()
Yeah I think some of it was a case of reading the old tutorials. Do you have anything that shows how to use the widgets? I tried guessing and tried something like:
Window* btnExit = wmgr.createWindow("TaharezLook/PushButton", "btnExit");
But it fails so I assume you do it a different way? Can you point me to any tutorials or anything that would help me instantiate widgets and use them?
Window* btnExit = wmgr.createWindow("TaharezLook/PushButton", "btnExit");
But it fails so I assume you do it a different way? Can you point me to any tutorials or anything that would help me instantiate widgets and use them?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Unhandled execption on System::create()
Hmm. That code should work - I wonder what you mean by it fails? Perhaps you're not hooking it into an active window / root window?
One source of examples, is the CEGUI sample apps. Another place you can look is Widget Galore. Some parts of this are out-dated, but the window creation parts should still be current.
HTH
CE.
One source of examples, is the CEGUI sample apps. Another place you can look is Widget Galore. Some parts of this are out-dated, but the window creation parts should still be current.
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Who is online
Users browsing this forum: No registered users and 2 guests
