[IronPython] ActiveX Winfowms and IronPython

Max Bolingbroke max.bolingbroke at resolversystems.com
Wed Jul 26 12:30:48 CEST 2006

Михаил Подгурский wrote:
>  Is there any way to add any ActiveX controls to WinForm in IronPython
>  code?

The procedure should be similar to that used in C#. There are details 
about that here: http://www.codeproject.com/csharp/importactivex.asp.

Basically, all you need to do is generate a managed wrapper for the 
ActiveX component using one of the tools in the .NET SDK:

AxImp /source activex_control_path_name

Once you have this wrapper, you import it into IronPython in the usual 
way (clr.AddReference), and can create instances of the control (you can 
browse the assembly that has been generated to find the control class 
using dir() in IronPython or the SDK tool ildasm) and add it to your 
windows form with ease. Please note, however, that this is all theory: I 
haven't actually tried doing this, but I can't see any obstacles to this 
working. That said, there may very will be some issues here, so I'd be 
interested to hear how you get on!

Hope this helps,


More information about the Ironpython-users mailing list