Access Violation for run->()
Posted: Thu Jul 08, 2004 11:41 pm
Hi,
I have a CIrrlichtManager class that has a function initIrrlicht which creates a device with the same code (with OPENGL instead of software) in the hellworld tutorial, so that is not the problem. In my main.cpp I create an instance of my CIrrlichtManager class like so:
CIrrlichtManager irrlichtManager;
Then I call the initIrrlicht function like so:
irrlichtManager.initIrrlicht();
I then check to see if the device is null (to see if that was the problem, but it isnt).
Then I do this (the line where the program errors after debugging with msvc++ 2003)
while(irrlichtManager.device->run()) //Error line
{
irrlichtManager.driver->beginScene(true, true, Scolor(0,100,100,100));
irrlichtManager.smgr->drawAll();
irrlichtManager.guienv->drawAll();
irrlichtManager.driver->endScene();
}
It all compiles fine but when I run it, the program crashes and I when I debug it in MSVC++ 2003 it errors on the while loop for run->() with this error:
Unhandled exception at 0X003d004a in OninWars.exe: OxC0000005: Access violation writing location 0x0016f03d
Thanks for any help
I have a CIrrlichtManager class that has a function initIrrlicht which creates a device with the same code (with OPENGL instead of software) in the hellworld tutorial, so that is not the problem. In my main.cpp I create an instance of my CIrrlichtManager class like so:
CIrrlichtManager irrlichtManager;
Then I call the initIrrlicht function like so:
irrlichtManager.initIrrlicht();
I then check to see if the device is null (to see if that was the problem, but it isnt).
Then I do this (the line where the program errors after debugging with msvc++ 2003)
while(irrlichtManager.device->run()) //Error line
{
irrlichtManager.driver->beginScene(true, true, Scolor(0,100,100,100));
irrlichtManager.smgr->drawAll();
irrlichtManager.guienv->drawAll();
irrlichtManager.driver->endScene();
}
It all compiles fine but when I run it, the program crashes and I when I debug it in MSVC++ 2003 it errors on the while loop for run->() with this error:
Unhandled exception at 0X003d004a in OninWars.exe: OxC0000005: Access violation writing location 0x0016f03d
Thanks for any help