[python-win32] COM object Dispatch Error
lucemia
lucemia51 at hotmail.com
Sat Aug 4 20:14:51 CEST 2007
Hi:
I have a problem about using win32com in python.
I am using a software called CSTStudio to do my project.
CSTStudiod could be used in VBA Script currectly to start or execute program via COM interface,
but it crashed in python win32com.
> h = win32com.client.Dispatch('CSTStudio.Application') <--- it is ok!
> mws = h.OpenFile('C:\\CSTProject\\ga2layer_v1.psf') <--- the CSTStudio will open the file currectly but failed to retrun mws.
What should i do to solve this problem?
Thanks
lucemia
Error Message:
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 1.2
>>> import win32com
>>> import win32com.client
>>> win32com.client.Dispatch('CSTStudio.Application')
<COMObject CSTStudio.Application>
>>> h = win32com.client.Dispatch('CSTStudio.Application')
>>> mws = h.OpenFile('C:\\CSTProject\\ga2layer_v1.psf')
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
mws = h.OpenFile('C:\\CSTProject\\ga2layer_v1.psf')
File "<COMObject CSTStudio.Application>", line 2, in OpenFile
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 290, in _get_good_object_
return self._get_good_single_object_(ob)
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 275, in _get_good_single_object_
return self._wrap_dispatch_(ob, userName, ReturnCLSID)
File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line 123, in _wrap_dispatch_
return Dispatch(ob, userName, returnCLSID,None,UnicodeToString)
File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line 96, in Dispatch
return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, UnicodeToString, clsctx)
File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line 44, in __WrapDispatch
return dynamic.Dispatch(dispatch, userName, WrapperClass, typeinfo, UnicodeToString=UnicodeToString,clsctx=clsctx)
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 114, in Dispatch
typecomp = typeinfo.GetTypeComp()
AttributeError: 'NoneType' object has no attribute 'GetTypeComp'
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20070805/5c7e5aaa/attachment.html
More information about the python-win32
mailing list