[IronPython] Problem Loading DirectX?

Dino Viehland dinov at exchange.microsoft.com
Mon Jun 12 23:17:23 CEST 2006

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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Clay Culver
Sent: Sunday, June 11, 2006 6:52 PM
To: users at lists.ironpython.com
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=, Culture=neutral,
 >>> 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?


users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list