lucemia wrote:
> 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'
>>>>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Python-win32 mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-win32
Google on CSTStudiod didn't turn up anything so there's no way to know the
correct calling sequence for the OpenFile method. There is a reference to
userName in the traceback. Did you forget to supply a userName argument?
-Larry
_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32