Some trouble with inherited IEventReceiver

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
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Some trouble with inherited IEventReceiver

Post by Abraxas) »

I'm getting a crash with Irrlicht 1.8.3 that I can't figure out. Windows refuses to install the windows 7 SDK on my machine so it's difficult figuring out what irrlicht is doing. Basically:

Code: Select all

class QAbstractEventReceiver : public irr::IEventReceiver
{
public:
 
    QAbstractEventReceiver() {}
    ~QAbstractEventReceiver() {}
 
    virtual bool OnEvent(const irr::SEvent& event) { return true; }
};
I create a member variable (not pointer) in another object and assign in constructor:

Code: Select all

p_id->setEventReceiver(&m_aer);
Now Irrlicht runs fine if my mouse is outside the window with an empty loop:

Code: Select all

    while (m_device->run()) {
        if (m_device->isWindowActive()) {
            m_device->getVideoDriver()->beginScene(true, true, video::SColor(255, 100, 101, 140));
            m_device->getVideoDriver()->endScene();
        }
    }
But crashes as soon as I hover the mouse over the window with:
Exception thrown at 0x00000000 in QuadFighter.exe: 0xC0000005: Access violation executing location 0x00000000.

VS shows all local member of this class are initialized properly (but no symbols for irr objects).

Any ideas? Thanks for the help!
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Some trouble with inherited IEventReceiver

Post by mongoose7 »

The DLL has to match the application. Usually it is best to build both yourself. If you cannot build the DLL then you are in trouble. Perhaps check all the settings in the Irrlicht project and make sure yours are the same. The first thing is, if the DLL is a release build, you will have to make a release build of your project. That is, no debugging!
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Re: Some trouble with inherited IEventReceiver

Post by Abraxas) »

Thanks for the help!

Is there a reason why no debug DLL can be provided? are the symbols compiler and machine specific?

Also, should I uninstall the .NET framework and try reinstalling? I'm worried about gimping my machine or having windows install W10 without asking :/
CuteAlien
Admin
Posts: 9680
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Some trouble with inherited IEventReceiver

Post by CuteAlien »

Why .NET framework? Are you using the c# wrapper?
DLL's are somewhat compiler specific. We don't have the manpower to test too many dll versions.

My guess is that the object is probably no longer valid. But can't tell from your given code-snippet. It always help when you post enough code so other people can reproduce your problem by compiling that code-snippet themself.
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
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Re: Some trouble with inherited IEventReceiver

Post by Abraxas) »

I was wondering if there was some issue with inheritance or some known bug with setEventReceiver.

I've been using irrlicht for 7 or 8 years (and posting here for quite a few years) and never had this issue before, but recently came back and saw this. Anyway I'll put more time into figuring out the problem.

.NET framework is required for the windows 7.1 SDK which is required to build Irrlicht (or at least visual studio was asking for it)
CuteAlien
Admin
Posts: 9680
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Some trouble with inherited IEventReceiver

Post by CuteAlien »

Uhm - something strange there. No idea why .NET framework is needed for that. Also - you can use other SDK's. For that you have to change the platform toolset in your visual studio (project properties) to any other SDK (we simply use that because we deliver only a single dll and that one worked with all VS versions in the past - but no longer does with VS 2015 so we will change that in the future).
If you check-out Irrlich svn trunk that comes with a VS 2015 project file which already uses another platform toolset (thought I couldn't test that yet as VS 2015 doesn't work on my system so far *sigh*).
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
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Re: Some trouble with inherited IEventReceiver

Post by Abraxas) »

There was some reorganization of the irrlicht directories and I was using the wrong win32 dll (gcc, not VS).

Thanks for the help!
Post Reply