1. wxWidgets crash
- Posted by mb7001 Feb 19, 2015
- 1384 views
Hello all,
I am getting a machine level crash when running wxEuphoria v 0.17.0 and Euphoria version 4.0.5. This is the error:
C:\euphoria4.0\myprograms\Windows Tutorial\wXHelloWorld.exw:9 in procedure onPaint_HelloWin() A machine-level exception occurred during execution of this statement (signal 5) this = <no value> event = <no value> it = <no value> event_type = <no value> ^^^ call-back from Windows ... called from C:\euphoria4.0\include\wxeud.e:8038 in procedure wxMain() topWindow = 10451416 ... called from C:\euphoria4.0\myprograms\Windows Tutorial\wXHelloWorld.exw:12
The error does not occur when running some demos from wxEuphoria, but does seem to occur when using the onPaint routine.
I am using Windows Vista Business, Service Pack 3, 32 bit OS. The demo that I tried in wxEuphoria that worked was about.exw and calendar.exw. Also I tried the bench_draw.exw and it worked once, now I am getting a similar error. Please help and thank you.
2. Re: wxWidgets crash
- Posted by mb7001 Feb 19, 2015
- 1389 views
Just an update, I have not fixed the problem, but the problem seems intermittently disappear when running the hello_world.exw program. It works about every 1 out of 5 times. Every time though, the window does appear correctly. It seems to be caused after the window is created and painted. I am learning, but my programming skills are still pretty basic.
3. Re: wxWidgets crash
- Posted by ghaberek (admin) Feb 19, 2015
- 1364 views
Can you post the code you are using?
Remember to wrap your wxEVT_PAINT code with begin_drawing() and end_drawing() as shown in the example on the Events documentation page.
procedure onPaint( atom this, atom event_type, atom id, atom event ) atom dc dc = create( wxPaintDC, {this} ) begin_drawing(dc) -- ... do drawing here... end_drawing(dc) delete_instance(dc) end procedure set_event_handler( panel, -1, wxEVT_PAINT, routine_id("onPaint") )
Also, I wrapped your error output with triple curly brackets ( {{{ and }}} ) which preserves formatting. See CreoleHelp for more details.
-Greg
4. Re: wxWidgets crash
- Posted by mb7001 Feb 19, 2015
- 1372 views
Thanks for the formatting tip. Here is the code:
include wxeud.e constant HelloFrame = create(wxFrame,{0, -1, "My First Message", -1, -1, 200, 100}), HelloWin = create(wxPanel,{HelloFrame}) procedure onPaint_HelloWin(atom this, atom event, atom it, atom event_type) wx_puts(this, "Hello World!") end procedure set_event_handler(HelloWin, get_id(HelloWin), wxEVT_PAINT, routine_id("onPaint_HelloWin")) wxMain(HelloFrame)
It was straight from the "Getting Started" section in the wxEuphoria manual.
5. Re: wxWidgets crash
- Posted by ghaberek (admin) Feb 19, 2015
- 1373 views
Thanks for the formatting tip. Here is the code:
include wxeud.e constant HelloFrame = create(wxFrame,{0, -1, "My First Message", -1, -1, 200, 100}), HelloWin = create(wxPanel,{HelloFrame}) procedure onPaint_HelloWin(atom this, atom event, atom it, atom event_type) wx_puts(this, "Hello World!") end procedure set_event_handler(HelloWin, get_id(HelloWin), wxEVT_PAINT, routine_id("onPaint_HelloWin")) wxMain(HelloFrame)
It was straight from the "Getting Started" section in the wxEuphoria manual.
I guess that's a specific case. The routines wx_puts() and wx_printf() will automatically create and destroy a wxPaintDC if it is not provided.
Are you using the latest dll provided on the Bleeding edge page? There were some GDI+ issues with 0.17.0 and that may be related to your crash.
Here is a later build I made in 2013 that you can try: wxEuphoria-0.17.0-win32-alpha3.zip (4.73 MB)
-Greg
6. Re: wxWidgets crash
- Posted by mb7001 Feb 19, 2015
- 1329 views
I downloaded the latest dll's from the bleeding edge site. That fixed it perfectly. Thanks.