COM traceback translation

dsavitsk dsavitsk at e-coli.net
Mon Mar 11 18:10:51 EST 2002


next time i will rtfm before posting.  from pg 621 of python programming on
win32 ...
"Before a thread can use COM, it must call ... CoInitialize()"

-d


"dsavitsk" <dsavitsk at e-coli.net> wrote in message
news:Wu8j8.9099$k5.3517961 at newssvr28.news.prodigy.com...
> can anybody help with this one? there is a module called test_write.  when
> it is imported from a python prompt and generate_doc() is called it works
> fine.  When it is invoked by a COM object it throws this error.
>
> thanks,
>
> doug
>
>
>
> Traceback (most recent call last):
>   File "X:\epsp2\server\bin\test_write.py", line 5, in generate_doc
>     wordApp = win32com.client.Dispatch('Word.Application')
>   File "C:\Python\win32com\client\__init__.py", line 94, in Dispatch
>     dispatch, userName =
> dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
>   File "C:\Python\win32com\client\dynamic.py", line 81, in
> _GetGoodDispatchAndUserName
>     return (_GetGoodDispatch(IDispatch, clsctx), userName)
>   File "C:\Python\win32com\client\dynamic.py", line 72, in
_GetGoodDispatch
>     IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
> pythoncom.IID_IDispatch)
> pywintypes.com_error: (-2147221008, 'CoInitialize has not been called.',
> None, None)
>
>





More information about the Python-list mailing list