[python-win32] Dispatch Error

2007-07-09 Thread James Matthews
I see people using this code however it doesn't seem to work for me! Any help Thanks James Code: from win32com.client import constants, Dispatch outlook = Dispatch("Outlook.Application") Error com_error: (-2146959355, 'Server execution failed', None, None) Traceback (innermost last): File "

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2007-01-01 Thread Mark Hammond
Another random comment re CoInitialize in servers... Depending on your requirements, you may be better off with: try: pythoncom.CoInitializeEx(pythoncom.COINIT_MULTITHREADED) except pythoncom.com_error: # already initialized. pass (and as per Roger's comments, adding a flag to handle CoUni

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-29 Thread Bob Gailer
Roger Upole wrote: > Bob Gailer wrote: > >> Tim Golden wrote: >> >>> [Bob Gailer] >>> >>> OK. I don't know whether its running in a thread. I made no changes that I'm aware of that would cause the change in behavior. I will add the call to pythoncom.CoInitialize.

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-29 Thread Bob Gailer
Tim Golden wrote: >>> [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

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-29 Thread Tim Golden
>> [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

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-29 Thread Bob Gailer
Tim Golden wrote: > [Bob Gailer] > >> OK. I don't know whether its running in a thread. I made no >> changes that I'm aware of that would cause the change in >> behavior. I will add the call to pythoncom.CoInitialize. I am >> not familiar with this method. >> > > This is one of those got

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-29 Thread Tim Golden
[Bob Gailer] > OK. I don't know whether its running in a thread. I made no > changes that I'm aware of that would cause the change in > behavior. I will add the call to pythoncom.CoInitialize. I am > not familiar with this method. This is one of those gotcha's of Win32 COM programming; you can

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-28 Thread Bob Gailer
Roger Upole wrote: > Bob Gailer wrote: > >> I'm running this under my Apache2triad mod_python installation. >> Yesterday it was working. Today it is not. >> In the Apache config mptest.py is defined as the request handler. When >> called via an HTTP request I get the following: >> >> Traceback

[python-win32] Dispatch error 'CoInitialize has not been called'

2006-12-28 Thread Bob Gailer
I'm running this under my Apache2triad mod_python installation. Yesterday it was working. Today it is not. In the Apache config mptest.py is defined as the request handler. When called via an HTTP request I get the following: Traceback (most recent call last): File "H:\Python24\Lib\site-packa