[python-win32] By-reference COM method arguments not being treated as outputs

Mike Graham mikegraham at gmail.com
Mon Jul 27 21:30:45 CEST 2009


I used MakePy on a COM library with some success, but it does not seem
to work with methods with passed-by-reference arguments. The
documentation, as I understand it, says that the c_fun(in1, in2,
*out1, *out2) should transform into (out1, out2) = py_fun(in1, in2).

For example, MakePy makes me the method

	def PickObject(self, obj=defaultNamedNotOptArg,
x=defaultNamedNotOptArg, y=defaultNamedNotOptArg,
z=defaultNamedNotOptArg
			, obj_num=defaultNamedNotOptArg, entity_num=defaultNamedNotOptArg,
tolerance=9.9999997473787516e-06, PType=0):
		"""Retrieve an object ID and face or edge number by giving an object
type and global coordinates"""
		return self._ApplyTypes_(76, 1, (24, 0), ((16387, 3), (12, 1), (12,
1), (12, 1), (16387, 3), (16387, 3), (5, 49), (3, 49)), u'PickObject',
None,obj
			, x, y, z, obj_num, entity_num
			, tolerance, PType)

where obj_num and entity_num are outputs. I cannot call this with
object.PickObject(10, 0, 0, 0) like I should be able to or with
object.PickObject(10, 0, 0, 0, pythoncom.Empty, pythoncom.Empty),
which I've seen suggested (or with anything else I've tried in the
last spots).

How do I get this to treat these arguments right?


More information about the python-win32 mailing list