AKHIYAROV, Denis (WGK)
2015-09-30 15:07:53 UTC
Hello pywin32 users and developers,
Iâm generally pretty happy about using COM through comtypes, but get this cryptic error below.
https://github.com/enthought/comtypes/issues/87
http://stackoverflow.com/questions/32869070/comtypes-com-objects-method-returns-tuple-object-has-no-attribute-ctypes
I'm invoking a method of COM object with string argument using comtypes and method returns (it should return a COM string):
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-102-009507ff0086> in <module>()
----> 1 obj1=xobjData.GetDataType('string_name')
C:\Python\Python27\lib\site-packages\comtypes\__init__.pyc in call_with_inout(self_, *args, **kw)
657 # be iterable.
658 if len(outargs) == 1: # rescode is not iterable
--> 659 return rescode.__ctypes_from_outparam__()
660
661 rescode = list(rescode)
AttributeError: 'tuple' object has no attribute '__ctypes_from_outparam__'
Seems very cryptic error, any help?
--> 659 return rescode.__ctypes_from_outparam__()
660
ipdb> outargs
{0: VARIANT(vt=0x8, u'string_name')}
ipdb> rescode
(VARIANT(vt=0x8, u'string_name'), u'Long')
ipdb> exit
Denis Tauzikhovich Akhiyarov, Senior Consultant
15115 Park Row - Suite 250
Houston, Texas 77084
+1. 281.600.3685 (Direct)
+1. 918.200.3994 (Mobile)
+1. 281.646.1515 (Switchboard)
***@woodgroupkenny.com<mailto:***@woodgroupkenny.com>
www.msikenny.com<http://www.msikenny.com/>
www.woodgroupkenny.com<http://www.woodgroupkenny.com/>
[cid:***@01CF28A3.5A0DAE20]
Please consider the environment before printing this email.
This email and its attachments may contain information which is confidential and/or legally privileged. If you are not the intended recipient of this e-mail please notify the sender immediately by e-mail and delete this e-mail and its attachments from your computer and IT systems. You must not copy, re-transmit, use or disclose (other than to the sender) the existence or contents of this e-mail or its attachments or permit anyone else to do so.
Iâm generally pretty happy about using COM through comtypes, but get this cryptic error below.
https://github.com/enthought/comtypes/issues/87
http://stackoverflow.com/questions/32869070/comtypes-com-objects-method-returns-tuple-object-has-no-attribute-ctypes
I'm invoking a method of COM object with string argument using comtypes and method returns (it should return a COM string):
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-102-009507ff0086> in <module>()
----> 1 obj1=xobjData.GetDataType('string_name')
C:\Python\Python27\lib\site-packages\comtypes\__init__.pyc in call_with_inout(self_, *args, **kw)
657 # be iterable.
658 if len(outargs) == 1: # rescode is not iterable
--> 659 return rescode.__ctypes_from_outparam__()
660
661 rescode = list(rescode)
AttributeError: 'tuple' object has no attribute '__ctypes_from_outparam__'
Seems very cryptic error, any help?
c:\python\python27\lib\site-packages\comtypes\__init__.py(659)call_with_inout()
658 if len(outargs) == 1: # rescode is not iterable--> 659 return rescode.__ctypes_from_outparam__()
660
ipdb> outargs
{0: VARIANT(vt=0x8, u'string_name')}
ipdb> rescode
(VARIANT(vt=0x8, u'string_name'), u'Long')
ipdb> exit
Denis Tauzikhovich Akhiyarov, Senior Consultant
15115 Park Row - Suite 250
Houston, Texas 77084
+1. 281.600.3685 (Direct)
+1. 918.200.3994 (Mobile)
+1. 281.646.1515 (Switchboard)
***@woodgroupkenny.com<mailto:***@woodgroupkenny.com>
www.msikenny.com<http://www.msikenny.com/>
www.woodgroupkenny.com<http://www.woodgroupkenny.com/>
[cid:***@01CF28A3.5A0DAE20]
Please consider the environment before printing this email.
This email and its attachments may contain information which is confidential and/or legally privileged. If you are not the intended recipient of this e-mail please notify the sender immediately by e-mail and delete this e-mail and its attachments from your computer and IT systems. You must not copy, re-transmit, use or disclose (other than to the sender) the existence or contents of this e-mail or its attachments or permit anyone else to do so.