<div class="gmail_quote">sorry...now it goes in English...<br><br>I have a problem trying to invoke a function through FFI. I have bee using FFI y some functions with no problem but now I have "could not coerce arguments". This is the first time I have a void* parameter, so I believe that could be the problem.<br>
<br>The function definition is:<br><pre>int <b>odbx_set_option</b>(<br> odbx_t* <i><b>handle</b></i>,<br> unsigned int <i><b>option</b></i>,<br> void* <i><b>value</b></i> )<br><br><br><font size="4">Here is an example that shows how to use it in C:</font><br>
<br>option = ODBX_TLS_ALWAYS;<br>if( ( err = odbx_set_option( handle, ODBX_OPT_TLS, (void*) &option ) ) < 0 )<br>{<br> fprintf( stderr, "odbx_set_option(): %s\n", odbx_error( handle, err ) );<br> odbx_finish( handle );<br>
return err;<br>}<br><br></pre><br>This is my method that map that function with FFI:<br><br>apiSetOption: handle option: anOption value: aValue<br> "int odbx_unbind(odbx_t*)"<br> <cdecl: long 'odbx_set_option' (ulong ulong void*) module: 'opendbx' ><br>
^self externalCallFailed<br> <br><br>I proobed void*, void, ulong y ulong* but I had that error in all cases.<br><br>Here is how my method is used:<br><br>err := OpenDBX apiSetOption: self option:32 value:1. <br>
<br>So, can someone help me?<br><br>thanks,<br><font color="#888888"><br>
mariano<br>
</font></div><br>