<div dir="ltr">Yeah!&nbsp; Bert:<br><br>&nbsp;It works perfectly if I use char* and<br><br>self apiSetOption: handle option: bla value: &#39;aStringValue&#39;<br><br>If I use void* and <br><br>self apiSetOption: handle option: bla value: &#39;aStringValue&#39; asByteArray<br>
<br>it seems it doesn&#39;t arrives well to the library. <br><br>many thanks,<br><br>mariano<br><br><div class="gmail_quote">On Mon, Aug 18, 2008 at 4:33 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Am 18.08.2008 um 21:29 schrieb Bert Freudenberg:<div><div></div><div class="Wj3C7c"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am 18.08.2008 um 20:44 schrieb Mariano Martinez Peck:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
On Mon, May 26, 2008 at 10:44 AM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" target="_blank">marianopeck@gmail.com</a>&gt; wrote:<br>
<br>
<br>
On Mon, May 26, 2008 at 10:36 AM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt; wrote:<br>
<br>
On 26.05.2008, at 15:21, Mariano Martinez Peck wrote:<br>
<br>
&quot;could not coerce arguments&quot;<br>
<br>
int odbx_set_option(<br>
 &nbsp;odbx_t* handle,<br>
 &nbsp;unsigned int option,<br>
 &nbsp;void* value )<br>
apiSetOption: handle option: anOption value: aValue<br>
 &nbsp;&quot;int odbx_unbind(odbx_t*)&quot;<br>
 &nbsp;&lt;cdecl: long &#39;odbx_set_option&#39; (ulong ulong void*) module: &#39;opendbx&#39; &gt;<br>
 &nbsp;^self externalCallFailed<br>
<br>
err := OpenDBX apiSetOption: self option:32 &nbsp;value:1.<br>
<br>
<br>
The first argument appears to be a pointer to a handle object. You probably should not declare that as ulong if you then pass &quot;self&quot; (which I assume is a ExternalStructure subclass). But that depends on how you acquire the handle, and how you represent it in the image.<br>

<br>
Yes you are right, sorry. It was not self, but a attribute called handle. My mistake.<br>
<br>
<br>
The argument to void* should be a ByteArray or WordArray, methinks, I&#39;d try &quot;WordArray with: 1&quot; if you want to pass a pointer to the Integer 1.<br>
<br>
- Bert -<br>
<br>
Sounds interesting. I will test it and then I tell you.<br>
<br>
<br>
<br>
Bert: I test this using WordArray and I work perfect in all the cases the value was a number. But the type in the function definition is void*. So, now, I need to send not only a 1 or 0, but a String. In this case, I cannot do WordArray with: &#39;aStringValue&#39; &nbsp;neither ByteArray with: &#39;aStringValue&#39; . What can I do in this case? Do you have any idea?<br>

<br>
I mean, I need to use the same parametrer void*, sending it a number or a string.<br>
</blockquote>
<br>
<br>
Declare the method again like<br>
<br>
apiSetOption: handle option: anOption string: aString<br>
 &nbsp;&lt;cdecl: long &#39;odbx_set_option&#39; (ulong ulong char*) module: &#39;opendbx&#39; &gt;<br>
 &nbsp;^self externalCallFailed<br>
<br>
and use that by simply passing a String (don&#39;t even bother to convert to ByteArray [but watch out for the terminating 0]).<br>
<br>
- Bert -<br>
</blockquote>
<br>
<br>
<br></div></div>
... that is, unless this works with the original method (I&#39;m not sure):<br>
<br>
self apiSetOption: handle option: bla value: &#39;aStringValue&#39; asByteArray.<br><font color="#888888">
<br>
<br>
- Bert -<br>
<br>
<br>
<br>
</font></blockquote></div><br></div>