You want to either do a clr.AddReference* (ByPartialName, or one of the other
variants), or use the returned assembly object returned from the Load functions.
If you use AddReference then the import statement will work as you have it
here. If you just use the returned assembly object, you'll want something like:
>>> dx = clr.LoadAssemblyByPartialName("Microsoft.DirectX")
>>> x = dx.Microsoft.DirectX
x is now the DirectX namespace, and you can access types out of it using
x.SomeType()
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clay Culver
Sent: Sunday, June 11, 2006 6:52 PM
To: [email protected]
Subject: [IronPython] Problem Loading DirectX?
I'm having a problem loading DirectX (MDX) 2.0. Here is what I am trying:
>>> import clr
>>> clr.LoadAssemblyByPartialName("Microsoft.DirectX")
Microsoft.DirectX, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
>>> import Microsoft.DirectX
Traceback (most recent call last):
File , line 0, in <stdin>##17
File , line 0, in __import__##4
ImportError: cannot import DirectX from Microsoft
Does anyone know what is wrong with this?
Thanks!
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com