Any event handling crashes wxWidgets?!

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Ngineer
In need of some credit
In need of some credit
Posts: 2
Joined: Mon Jul 29, 2019 2:52 pm

Any event handling crashes wxWidgets?!

Post by Ngineer » Mon Jul 29, 2019 2:58 pm

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!

User avatar
doublemax
Moderator
Moderator
Posts: 13879
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Any event handling crashes wxWidgets?!

Post by doublemax » Mon Jul 29, 2019 3:45 pm

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?
Use the source, Luke!

Ngineer
In need of some credit
In need of some credit
Posts: 2
Joined: Mon Jul 29, 2019 2:52 pm

Re: Any event handling crashes wxWidgets?!

Post by Ngineer » Mon Jul 29, 2019 3:57 pm

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!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3353
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Any event handling crashes wxWidgets?!

Post by ONEEYEMAN » Mon Jul 29, 2019 8:29 pm

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.

Post Reply