I&#39;ll try the ctypes... thanks for pointing me in the right direction and your help is much appreciated.<br><br>Ash<br><br><div class="gmail_quote">On Mon, Jun 7, 2010 at 10:02 AM, Jeff Hardy <span dir="ltr">&lt;<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Sun, Jun 6, 2010 at 8:20 PM, Ashley Abraham &lt;<a href="mailto:abrahams84@gmail.com">abrahams84@gmail.com</a>&gt; wrote:<br>

&gt; Jeff,<br>
&gt;     I think I miss read your reply, what you are saying is that if it based<br>
&gt; on ctypes it will work in IronPython as well is it?? I thought you needed<br>
&gt; IronClad and so on make it work.<br>
<br>
</div>Yeah, with ctypes IronPython can call native code directly - it<br>
actually uses P/Invoke behind the scenes to do it. Python also<br>
implements ctypes, as do Jython and PyPy, so any code that you write<br>
using ctypes should work on any Python implementation.<br>
<br>
I haven&#39;t tested this (seeing as I don&#39;t have the exact DLL) but it<br>
should be pretty close:<br>
<br>
from ctypes import *<br>
vniwave = CDLL(&#39;vniwave.dll&#39;)<br>
<br>
cwavec = vniwave.cwavec<br>
cwavec.restype = c_int<br>
cwavec.argtypes = [c_int, c_int, POINTER(c_char_p)]<br>
<br>
The only part I&#39;m not sure about is the string[] - I&#39;m assuming the C<br>
function takes a char**.<br>
<br>
Alternatively, you could write the P/Invoke declarations in a C# class<br>
library and load that into IronPython using clr.AddReference, but I&#39;d<br>
recommend using ctypes.<br>
<div><div></div><div class="h5"><br>
- Jeff<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br>