> thanks for the detailed analysis and the clear explanation.  I've been
looking
> at the code and probably have another, even better, approach.
> 
> The missing 'extra' parameter in the create(cls, value, extra=None)
implementaition
> in comtypes\safearray.py, line 62, that you retrieve from the 'value'
parameter
> is defined in an outer scope of this method, in line 44 in the enclosing
> '_make_safearray_type' function.  So it seems the easiest way to pass this
parameter
> to 'create(...)' is this simple patch:
> 
> (...)

I've tried your approach and it works. You're right, your solution is
better, I did not see that the extra variable was bound in the
_make_safearray_type closure.

> This patch also has the advantage that you not only can pass a sequence
> of 'Pair' structures, in your case, as return value from your
ITest_Test(...)
> method, but you can also return simply a sequence of tuples like so:
> 
> >             def ITest_Test(self, in, out):
> >                   return [(u'1', u'2'), (u'2', u'3')]

Right, that's how I wanted to write the return value originally, but because
I thought I needed to get a value for extra somehow, I had to return a list
of Pair instances.

Saludos,


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to