[python-win32] Python Error - Cannot Initialize OLE

Gerrat Rickert grickert at coldstorage.com
Fri Apr 28 03:04:23 CEST 2006

I'm writing an application to control some PLC's,and during
initialization a little Window pops up with 'Python Error' in the title
and the message 'Cannot Initialize OLE'.  It doesn't seem to affect my
application other than that error message at the start.


I've got a GUI running in the main thread, 1 thread doing OPC
communications to an OPC server (thanks to some help from Norm
Petterson),  and two other worker threads implementing business logic.
The main thread creates a couple Queues and passes them to the other
threads so they can all communicate.  In the main thread, I've set
sys.coinit_flags = 0 before importing pythoncom.  Each of the other
threads call pythoncom.CoInitializeEx(pythoncom.COINIT_MULTITHREADED).
I have Mark Hammond's book on python programming on Win32, but I'm still
confused on how exactly to get all my threads communicating well.  This
setup seems to work, except for that error window that pops up near the
start (I can't even tell exactly where it's cropping up).


Does anyone know what causes this error window, or what I'm doing wrong?


Thanks for any help,

            Gerrat Rickert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060427/bc11b0e5/attachment.html 

More information about the Python-win32 mailing list