Re: Machine Level Exception Error

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...
Icy_Viking said...
public constant xAG_InitGraphics = define_c_func(gui,"+AG_InitGraphics",{C_STRING},C_INT) 
 
public function AG_InitGraphics(sequence driver) 
	return c_func(xAG_InitGraphics,{driver}) 
end function 

Don't you have to allocate_string(driver) (and free it) and pass that memory address in Euphoria? Or does libffi/C_STRING take care of that?

jmduro's code is passing 0, perhaps "dummy" would be a better test.

C_STRING does take care of string_allocation for you. https://github.com/ghaberek/libffi-euphoria/blob/main/include/std/ffi.e

However based on the other replies, it may be better to use C_POINTER in this case. However it seems the issue still isn't resolved yet.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu