[Bill]
I've created an addin derived from the example in the ..\win32com\demos
directory (outlookAddin.py). I've also taken a look at the source code
for the SpamBayes addin.

The addin works, but I get an error from Outlook when I close Outlook
and then *immediately* try and restart it. The error from Outlook
is "The operation failed."

[Mark]
Outlook is fairly complicated ;)  Depending on how it is configured, a
mapisp32.exe, responsible for mail delivery, does hang around a few seconds
after outlook terminates, and I recall problems restarting Outlook in this
period even without a plugin loaded.

Thus, I'm afraid I don't believe this is specific to Python (ie, I've no
idea! :)  If some evidence does convince me otherwise, I'd then start
looking at what pythoncom._GetGatewayCount() and/or _GetInterfaceCount()
returns as the plugin terminates and ensure they are both zero before
looking deeper (spambayes has never managed zero here - IIRC it is the
gateway count that is always 2).

Mark,

Thank you for the information!

I've changed "OnDisconnection()" to look like this,

def OnDisconnection(self, mode, custom):
        self.application = None
        self.activeExplorer = None
        print "Gateway Count: ", pythoncom._GetGatewayCount()
        print "Interface Count: ", pythoncom._GetInterfaceCount()

and the Trace Collector output is,

Object with win32trace dispatcher created (object=None)
Gateway Count:  2
Interface Count:  4

Is there something I should try to get the Interface Count down to zero?

Thanks again for your help!!

Bill
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to