1. wxWidgets crash

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.

new topic     » topic index » view message » categorize

2. Re: wxWidgets crash

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: wxWidgets crash

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: wxWidgets crash

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: wxWidgets crash

mb7001 said...

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: wxWidgets crash

I downloaded the latest dll's from the bleeding edge site. That fixed it perfectly. Thanks.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu