Getting run-time exception

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Getting run-time exception

Postby POLSKASH » Sat Jul 02, 2005 05:59

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?

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Re: Getting run-time exception

Postby POLSKASH » Sat Jul 02, 2005 16:12

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?

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: Getting run-time exception

Postby jacmoe » Sat Jul 02, 2005 16:44

Try to debug your program - it will probably tell you what's wrong. ;)

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Re: Getting run-time exception

Postby POLSKASH » Sat Jul 02, 2005 17:51

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");

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: Getting run-time exception

Postby jacmoe » Sat Jul 02, 2005 20:11

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. ;)

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Re: Getting run-time exception

Postby POLSKASH » Sun Jul 03, 2005 02:26

Here's what the logger says:

03/07/2005 02:22:06 (Error) Exception: DefaultResourceProvider::load - GUIScheme.xsd does not exist

User avatar
Acrion
Just popping in
Just popping in
Posts: 18
Joined: Tue Jun 28, 2005 18:45
Location: Maine, USA
Contact:

Re: Getting run-time exception

Postby Acrion » Sun Jul 03, 2005 02:42

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?
[font=Verdana][size=xx-small]"It's not hard to stand out when the general level of competence is so low" -EMH[/size][/font]
namik@flashmail.com

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Re: Getting run-time exception

Postby POLSKASH » Sun Jul 03, 2005 02:53

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Getting run-time exception

Postby CrazyEddie » Sun Jul 03, 2005 09:55

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

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Re: Getting run-time exception

Postby POLSKASH » Sun Jul 03, 2005 17:03

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.

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: Getting run-time exception

Postby jacmoe » Sun Jul 03, 2005 18:08

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 ;)

User avatar
POLSKASH
Not too shy to talk
Not too shy to talk
Posts: 44
Joined: Mon Jun 20, 2005 14:45

Re: Getting run-time exception

Postby POLSKASH » Mon Jul 04, 2005 01:11

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?

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: Getting run-time exception

Postby jacmoe » Mon Jul 04, 2005 02:30

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) ;)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 12 guests