Error on Visual Studio

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
FrenChQWerTy
Posts: 3
Joined: Sat Jun 03, 2017 3:10 pm

Error on Visual Studio

Post by FrenChQWerTy »

Hi everyone,

When I launched my executable on Visual Studio, it works. But when I launched it on Windows' file explorer, it stopped working and when I launch debug mode, Visual Studio starts and I have this mistake : Unhandled exception to 0x00007FF6D3C9551B in "Project Name" .exe: 0xC0000005: Access Violation when reading location 0x0000000000000000.

:x :x :x :x :x :x :x

Here is the code :

this->spriteBank = this->_guienv->addEmptySpriteBank(irr::io::path("ressources/cursor"));
cursor = this->_driver->getTexture("ressources/cursor/cursor.png");
if (cursor)
this->cursorSize = cursor->getSize();
this->spriteBank->addTextureAsSprite(cursor);
this->SetMenuModelMainOptions();
this->setMenuModelSubButtons();

this->_device->getCursorControl()->setVisible(false);

irr::core::rect<irr::s32> tabctrlSize = this->tabctrl->getRelativePosition();
irr::s32 tabctrlWidth = tabctrlSize.getWidth();
irr::s32 tabctrlHeight = tabctrlSize.getHeight();
this->midTabctrl = tabctrlSize.getCenter();

this->event.setSelected(this->selected);
this->event.setSavesListBox(this->_guienv->addListBox(irr::core::rect<int>(tabctrlWidth / 10,
tabctrlHeight / 5,
tabctrlWidth - (this->midTabctrl.X / 8 ),
tabctrlHeight - (this->midTabctrl.Y / 3)),
this->tabctrl, 1), this->_saves);
this->saveSubMenuSpriteSize = this->spriteBank->getTexture(irr::u32(MenuModel::SpriteName::SAVE_SUB_MENU))->getSize(); // This line doen't works

Thanks for help
Have a good day
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error on Visual Studio

Post by CuteAlien »

You should check your pointers. One common problem is that you can have a different working directory now. And all paths (for media) are relative to that. So it might no longer find your files which you try to load. But can figure that out by checking results... (which you should do anyway always).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply