Adding a button to a blank form makes program crash on exit Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
softport
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Jan 28, 2012 3:55 pm
Location: Houston TX
Contact:

Adding a button to a blank form makes program crash on exit

Post by softport » Wed Dec 12, 2012 4:35 pm

Hello, I have wxWidgets version 7.4.2.569 . Just upgraded a few months ago, and I'm pretty sure that this is the first time I have tried to write a new program with it.

The problem I'm having is this: adding a single button, to an empty frame, results in an executable that crashes when I close it. I get the 'Would you like to notify Microsoft' warning that the program just crashed. The executable of an empty frame works fine. When I run the program from inside the IDE, the program window closes but the debugger is still running, and I have to manually hit the "Stop Execution" button.

The projects from before the upgrade all generate executables without this problem, except.. A couple of them
generated compile errors related to style settings. Had to remove the 'offending' style attributes on this line in Frm.h:
#define HidapiFrm_STYLE wxCAPTION | wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX | wxOffendingStyle

I don't know if the two things are related, or what to do to fix this.

Thanks for any advice

Update:
It appears to be fixed. Somehow I ended up with two button entries in the event table, but only one button
existed on the form. In the properties tab of the existing button, the event name pointed to event table entry
of the button that did NOT exist. I hope that made as much sense to you as it did to me :). Very strange.

The odd thing is that it must have happened at least twice in a row, with two very simple projects.
Windows XP, wxDev-C++ 7.4.2.259, wxWidgets 2.8.12, MingW

Post Reply