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?
irrklang System.AccessViolationException
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...
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...
Re: irrklang System.AccessViolationException
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.c.h.r.i.s wrote:An unhandled exception of type 'System.AccessViolationException' occurred in openworldsclient.exe