[python-win32] Multithreaded COM, when do I need to CoUniniti alise?

Geoffrey Talvola gtalvola at nameconnector.com
Fri Oct 10 17:38:02 EDT 2003


Moof wrote:
> After playing around with the COMKit part of Webware and deciding it
> isn't as simple as it looks, I now find I'm doing a little something
> like this: 

You shouldn't need to do any calls to CoInitializeEx or CoUninitialize.
Just make sure that your AppServer.config file has

	'EnableCOM': 1,

in it.  This will cause all of the WebKit threads to _automatically_ have
CoInitializeEx(pythoncom.COINIT_MULTITHREADED) called with the thread
starts, and pythoncom.CoUninitialize() called when the thread ends.  (That's
what COMKit does -- it installs the hooks necessary to make sure these
functions are called.)

Is there some reason why this isn't sufficient?

- Geoff




More information about the Python-win32 mailing list