Ok. Another clue (slightly blushing that I didn't notice this before..).
I focus on the Position.GetComponents(...) for the moment.
Recall that this should set the orientation (9 values) and the
position (3 values) by means of an array passed in by reference.

To my surprise, it returns the same numbers as I put in. So, the
following is happening in the terminal:
>>> l = range(12)
>>> res = p1.Position.GetComponents(l)
>>> print res
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)

The values though are incorrect, I also tried with floats, but the
result is the same. I get back an exact copy of what I put in.

Regarding the workaround, can I mix comtypes and win32com?
So, can I only (try) to use comtypes to let this call succeed?
All other calls I have tried work flawlessly with win32com.

Thanks for the effort! Much appreciated.




On Thu, Jul 17, 2014 at 9:26 PM, Tim Roberts <t...@probo.com> wrote:

> Marco Nawijn wrote:
> >
> > Your answer implies that they are not declared correctly, because the
> > parameter is really required. It throws an exception with "invalid
> > number of parameters" if you leave it out.
>
> Many people write their COM objects so that they work from C++ without
> giving a rip about the rules that allow them to play nicely with other
> languages.
>
> Do you get one return value, or two?  Perhaps they have written it so it
> looks like an in/out parameter.  If so, the modified array would be the
> second return value.
>
>
> > If the type is somehow not declared correctly, is there a workaround?
>
> An EASY workaround?  No.  With the comtypes package, you can force
> Python to call almost any interface that can be designed by the
> perverted mind, but it's not automatic.  It means you have to write
> accurate declarations for all of the methods yourself.  There are good
> examples on the interwebs, but if you don't have good documentation to
> begin with, it will be painful.
>
> --
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to