Can I use win32 COM object in a thread?

Pelmen pelmenmail at mail.ru
Thu Dec 15 06:07:04 CET 2005


Sorry for post, answer was near ... just do search

2. Ixokai

From: "Ixokai" <use... at ixokai.net>
Mon, 9 Feb 2004 11:05:08 -0800


Basically, adodbapi uses COM, and COM and threads require a bit of
care,
apparently.  Your webkit thing may be using a thread to handle stuff.


import pythoncom
pythoncom.CoInitialize()
... code ...
pythoncom.CoUnitialize()


You need to call pythoncom.CoInitialize() once for each thread...
theres
something about sys.coinit_flags = 0 (or 1) that may be nessecary but I

don't know what they mean precisely :) 


--Stephen




More information about the Python-list mailing list