[python-win32] Re: problems in returning parameters using a COM client

Don Dwiggins dond@advancedmp.com
19 Dec 2002 13:23:00 -0800


Jens B Jorgensen writes:
> Those parameters are most likely [in, out] params. This means you must pass
> something in. Try:

> xpos, ypos = cd.GetPosition(0, 0)

Adding a bit to Jens' comments: [in, out] params need special treatment to
avoid the need to modify a parameter in place.  Python's approach is to have
you pass in the initial value, then get the updated value as part of the
result (which will be a sequence, beginning with the COM object's return
value, and containing all [in, out] and [out] params in left-to-right
order).  For [out] params, it's a bit simpler: they'll just appear in the
result sequence.

Also, a useful tool for working with COM components is Microsoft's OLE/COM Object
Viewer (http://www.microsoft.com/com/resources/oleview.asp).  

Enjoy,
-- 

Don Dwiggins		     "In a time of drastic change it is the learners who
d.l.dwiggins@computer.org     survive; the 'learned' find themselves fully equipped
                              to live in a world that no longer exists."
                               --  Eric Hoffer