Page 1 of 1

Any event handling crashes wxWidgets?!

Posted: Mon Jul 29, 2019 2:58 pm
by Ngineer
Hi everyone,

After so much debugging I'm almost sure this is not a problem with my code. I just freshly installed wxWidgets 3.1.2 on VS 2015. In short, any sort of event (button click, etc.) will crash the application when triggered.

The crash redirects to appbase.cpp:
// If the functor holds a method then, for backward compatibility, call
// HandleEvent():
wxEventFunction eventFunction = functor.GetEvtMethod();

if ( eventFunction )
>>> HandleEvent(handler, eventFunction, event);
else
functor(handler, event);
And the error is
Exception thrown at 0x0CFFFFFF in Example.exe: 0xC0000005: Access violation executing location 0x0CFFFFFF.

If there is a handler for this exception, the program may be safely continued.
I've checked my code and my installation countless times, and can't figure out whats wrong.

Can anyone give me a clue how to get around this?

Thanks so much!

Re: Any event handling crashes wxWidgets?!

Posted: Mon Jul 29, 2019 3:45 pm
by doublemax
Did you build wxWidgets yourself? If yes, how?

Does the crash also happen when you build and run the "minimal" sample that comes with wxWidgets?

Re: Any event handling crashes wxWidgets?!

Posted: Mon Jul 29, 2019 3:57 pm
by Ngineer
I built wx using the supplied VS solutions. I've investigated the issue further and can confirm it's not a problem with the code. The problem went away when I created a project from scratch and used the property sheet included in the wx download instead of linking to wx manually. Hope this helps someone in the future!

Re: Any event handling crashes wxWidgets?!

Posted: Mon Jul 29, 2019 8:29 pm
by ONEEYEMAN
Hi,
You shuoldn't link wx manually.

Recommended way is/was - copy minimal or any other sample to you preferred location and change the path to wx sources/libs.

Thank you.