irrklang System.AccessViolationException

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
c.h.r.i.s
Posts: 41
Joined: Mon Jan 22, 2007 8:38 pm

irrklang System.AccessViolationException

Post by c.h.r.i.s »

Hi! Im using Microsoft Visual C++ with irrlicht and irrklang. I added the fallowing code to my project:

engine->play2D("sounds/shire.wav", true);

After compiling the program runs and breaks whits the folloeing error message:

An unhandled exception of type 'System.AccessViolationException' occurred in openworldsclient.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

That Error occurs only if i use the code in windows forms application project templates. In Win32 Console Application Project Template it works and i can hear a sound.

Can everybody help me?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Your engine pointer is probably not valid. Check that you properly passed the value to your method.
c.h.r.i.s
Posts: 41
Joined: Mon Jan 22, 2007 8:38 pm

Post by c.h.r.i.s »

Hi! I think this is not the problem because the error occurs only in the windows forms project.

here is the complet code from "engine"
...other code...
#include <irrKlang.h>
...other code...
using namespace audio;//irrklang
...other code...
#pragma comment(lib, "irrKlang.lib")
...other code...
ISoundEngine* engine = 0;
...other code...
engine = createIrrKlangDevice();
if(!engine){}
else
{
engine->play2D("sounds/shire.wav", true);
}
...other code...

there are no other functions or variables using "engine" or any other irrklang functions...i just copyed the code from an console application project to the windows forms application project...i think that problem should not be...
c.h.r.i.s
Posts: 41
Joined: Mon Jan 22, 2007 8:38 pm

Post by c.h.r.i.s »

can somebody help me?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Re: irrklang System.AccessViolationException

Post by niko »

c.h.r.i.s wrote:An unhandled exception of type 'System.AccessViolationException' occurred in openworldsclient.exe
What are you using, C++/CLI? Or managed C++? Never tried out irrKlang with that, but it should not be a problem at all. It looks like it is a problem of your code. Maybe you could show us exactly the place where your program crashes.
Post Reply