On Tue, Jun 25, 2013 at 4:22 AM, Luís Oliveira <span dir="ltr"><<a href="mailto:loliveira@common-lisp.net" target="_blank">loliveira@common-lisp.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello Mirko,<br>
<div class="im"><br>
On Tue, Jun 25, 2013 at 1:56 AM, Mirko Vukovic <<a href="mailto:mirko.vukovic@gmail.com">mirko.vukovic@gmail.com</a>> wrote:<br>
> I am trying to link to a VISA library (VISA is used to control data<br>
> acquisition instruments), visa32.lib compiled for Windows.  The library is<br>
> shipped with Tektronix software.<br>
<br>
</div>I'm surprised loading it works. That sounds like a static library.<br>
<div class="im"><br>
<br>
> Using `nm' I did find:<br>
> 00000000 I __imp__viOpenDefaultRM@4<br>
> 00000000 T _viOpenDefaultRM@4<br>
<br>
</div>This looks like the stdcall calling convention. (See "Name-decoration<br>
convention" in <<a href="http://msdn.microsoft.com/en-us/library/zxk0tw93(v=vs.71).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/zxk0tw93(v=vs.71).aspx</a>>.)<br>
Passing ":convention :stdcall" to DEFCFUN should work.<br></blockquote><div><br></div><div>As a side point, I'm not sure if cffi-libffi works with stdcall. I think I put the code in, but having nothing to test it on, I have no idea if it works. If you have some structures-by-value functions to call, it would be good to test it (but you'll have to do the debugging if it fails).</div>

<div><br></div><div>Liam</div></div>