[Python.NET] Cannot initialize OLE

Daniele Esposti expo at expobrain.net
Wed Dec 3 02:18:37 CET 2008

Feihong Hsu ha scritto:
> I believe Brian's assessment is correct. The easiest way to handle this 
> is to use pywin32's pythoncom module to set the threading model. You can 
> find a sample of how to do that here:
> http://www.ironpython.info/index.php/Using_the_WebBrowser_Widget
> In the sample, the WebBrowser widget (which uses ActiveX underneath) is 
> embedded in a form. By invoking pythoncom.CoInitialize(), we set the 
> threading model to STA which prevents the program from crashing when it 
> initializes the form.


import pythoncom

and every it's working right.
Thank's to all

More information about the PythonDotNet mailing list