[python-win32] Dispatch error 'CoInitialize has not been called'
Tim Golden
mail at timgolden.me.uk
Fri Dec 29 21:17:08 CET 2006
>> [Bob Gailer]
> Yeah, but when I said it was working, it was working in the server!
> Wednesday AM just fine. Wednesday afternoon suddenly not working fine. I
> swear I didn't change anything!
>
> Is there some way my program can introspect? to see if it is in a thread?
It's a bit clunky, but I think you can do this:
<code>
import threading
import pythoncom
if threading.currentThread ().getName () <> 'MainThread':
pythoncom.CoInitialize ()
</code>
TJG
More information about the Python-win32
mailing list