[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope
Subject:    Re: [Zope] Integrating Zope with Excel.
From:       Toby Dickenson <tdickenson () devmail ! geminidataloggers ! co ! uk>
Date:       2004-08-31 15:37:19
Message-ID: 200408311637.19745.tdickenson () devmail ! geminidataloggers ! co ! uk
[Download RAW message or body]

On Friday 27 August 2004 18:39, Joe Goldthwaite wrote:
> He also suggested that I manually call pythoncom.CoInitialize(). 

You need to call it once in every thread, to initialize com *for* *that* 
*thread*.

calling it before every request is a quick way to ensure that it is called at 
least once. the redundant calls probably wont do any short term harm, but its 
bad style. Traditionally CoInitialize is called by the code that creates the 
thread - it doesnt belong in application code.

pythoncom.CoInitialize() will initialize your threads using com's apartment 
threading mode, which is not 100% identical to zope's threading rules. To be 
safe you really should be using CoInitializeEx and some other magic 
parameters.  This has come up many times before..... check out 
http://www.zopelabs.com/cookbook/993002968, or google for "dickenson zope 
coinitializeex"

-- 
Toby Dickenson
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic