I'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"><<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a>></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 <<a href="mailto:abrahams84@gmail.com">abrahams84@gmail.com</a>> wrote:<br>
> Jeff,<br>
> I think I miss read your reply, what you are saying is that if it based<br>
> on ctypes it will work in IronPython as well is it?? I thought you needed<br>
> 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't tested this (seeing as I don't have the exact DLL) but it<br>
should be pretty close:<br>
<br>
from ctypes import *<br>
vniwave = CDLL('vniwave.dll')<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'm not sure about is the string[] - I'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'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>