Page 1 of 1
Getting run-time exception
Posted: Sat Jul 02, 2005 05:59
by POLSKASH
I've finally gotten the ball rolling and getting some code down, but I'm getting this exception:
Unhandled exception at 0x7c81eb33 in Testing Ground.exe: Microsoft C++ exception: CEGUI::InvalidRequestException @ 0x0012e89c.
At this line:
CEGUI::SchemeManager::getSingleton().loadScheme("datafiles/schemes/TaharezLook.scheme");
Is it unable to load the scheme file? I have the datafiles folder with the schemes folder inside, and inside that, the TaharazLook.scheme file; All in my working directory, so what could be the problem?
Re: Getting run-time exception
Posted: Sat Jul 02, 2005 16:12
by POLSKASH
I changed the line to:
CEGUI::SchemeManager::getSingleton().loadScheme("datafiles\\schemes\\TaharezLook.scheme");
but still no luck. The exception occurs more specifically in the fstream.cpp file in this function:
_Myt *open(const char *_Filename,
ios_base::openmode _Mode,
int _Prot = (int)ios_base::_Openprot)
{ // open a C stream with specified mode
_Filet *_File;
if (_Myfile != 0 || (_File = _Fiopen(_Filename, _Mode, _Prot)) == 0)
return (0); // open failed
In the line with the if statement. Why isn't it opening the file correctly?
Re: Getting run-time exception
Posted: Sat Jul 02, 2005 16:44
by jacmoe
Try to debug your program - it will probably tell you what's wrong.

Re: Getting run-time exception
Posted: Sat Jul 02, 2005 17:51
by POLSKASH
Well, there's nothing to really debug :/
Here's all of the relevant code, and it's straight from the tutorials:
myRenderer = new CEGUI::DirectX9Renderer(device,0);
new CEGUI::System(myRenderer);
CEGUI::SchemeManager::getSingleton().loadScheme("datafiles\\schemes\\TaharezLook.scheme");
CEGUI::FontManager::getSingleton().createFont("datafiles\\fonts\\Commonwealth-10.font");
Re: Getting run-time exception
Posted: Sat Jul 02, 2005 20:11
by jacmoe
You should have a 'datafiles' directory in your current directory, with the correct stuff in it.
You are not trying to run your app from your IDE, are you?
A debug session will tell you if your app cannot find TaharezLook.scheme - or if there are other problems.
If you haven't looked, CEGUI.log might have some clues as to what's wrong.

Re: Getting run-time exception
Posted: Sun Jul 03, 2005 02:26
by POLSKASH
Here's what the logger says:
03/07/2005 02:22:06 (Error) Exception: DefaultResourceProvider::load - GUIScheme.xsd does not exist
Re: Getting run-time exception
Posted: Sun Jul 03, 2005 02:42
by Acrion
Make sure your "Debug Working Directory" is set to where your Binary is located. Also, ensure that the "datafiles\" directory is in the same directory as your exe.
Another thing you can try is to build your project then run the EXE that it created directly. (Not through the development IDE)
What compiler are you using?
Re: Getting run-time exception
Posted: Sun Jul 03, 2005 02:53
by POLSKASH
VC++.NET 2003. The working directory is set to where the datafiles folder is. GUIScheme.xsd is in the same folder along with TaharezLook.scheme.
I already tried running the .exe the build created, and that didn't work either, same problem.
Re: Getting run-time exception
Posted: Sun Jul 03, 2005 09:55
by CrazyEddie
What version of the code is this with? Unless it's 0.3.0 then the .xsd schema files really need to be in the directory where the .exe is.
If you're just building things using the provided directory layout, then 'bin' and 'datafiles' should be side by side and you need ../ at the begining of those paths you posted. If you have changed the directory layout in any way you will need to go through all of the xml files and fix up the paths contained therein.
CE
Re: Getting run-time exception
Posted: Sun Jul 03, 2005 17:03
by POLSKASH
How do I properly set up my project to work with CEGUI? I just kept copy/pasting in .dll files when it said this .dll was needed and that .dll was needed. Do I just need to copy in the bin folder and data files folder or what? Any special project settings? And why the "...\\" at the start of the file path?
I'm using 2.0 by the way.
Re: Getting run-time exception
Posted: Sun Jul 03, 2005 18:08
by jacmoe
0.3.0 is much easier to work with.
The \ is an escape character in C++ - when you want to use the \ (not the escape character), you need to "escape" it with \ - and it becomes "\\".
Not the best of explanations, but you have Google to provide a better one.
You can get rid of that by using "/" instead.
"\" is Windows path separators, and "/" is Unix path separators, btw.
".." means the parent directory.
If you want to know what project settings to use, just take a look at the settings for the provided sample projects

Re: Getting run-time exception
Posted: Mon Jul 04, 2005 01:11
by POLSKASH
Alright, I made the switch to 0.3.0. It says I'm missing .dll files when I run. How do I set the compiler (VC++.NET 2003) to use the .dll files in the bin folder? Or do I just have to copy/paste all the .dll files into the working directory?
Re: Getting run-time exception
Posted: Mon Jul 04, 2005 02:30
by jacmoe
You shouldn't be running it from the IDE, except when debugging.
If you are, you need to go into your project settings and set Command and Working Directory under Debugging.
(Command is Working Directory + the_name_of_your_exe)
