<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 24/01/2010 00:19, Andrew Evans wrote:
<blockquote
cite="mid:321b88ab1001231619i7f2031eav6a956a9b0f2190e2@mail.gmail.com"
type="cite">I am trying to call user32.dll into IronPython how do I do
this? Do I use clr.AddReference, that doesn't seem to do it.<br>
</blockquote>
<br>
clr.AddReference only works for .NET assemblies. user32.dll is not a
.NET assembly. To use it you will either need PInvoke or ctypes that
comes with IronPython 2.6.<br>
<br>
PInvoke relies on .NET attributes. It used to be the case that you
couldn't use these directly with IronPython but needed a simple C#
wrapper. The following article shows how to call into user32.dll using
a C# wrapper:<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.voidspace.org.uk/ironpython/winforms/part10.shtml">http://www.voidspace.org.uk/ironpython/winforms/part10.shtml</a><br>
<br>
Alternatively you can try clrtype.py that comes with IronPython 2.6.<br>
<br>
All the best,<br>
<br>
Michael Foord<br>
<br>
<blockquote
cite="mid:321b88ab1001231619i7f2031eav6a956a9b0f2190e2@mail.gmail.com"
type="cite"><br>
Suggestions<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a>
<a class="moz-txt-link-freetext" href="http://www.voidspace.org.uk/blog">http://www.voidspace.org.uk/blog</a>
READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.
</pre>
</body>
</html>