[python-win32] Python COM server corrupting VB parameter?
Gerry Stellenberg
gstellenberg at gmail.com
Mon Nov 29 07:20:46 CET 2010
I'm struggling through the development of some python COM server code as a
relative newbie and running into an issue. My win32com module is build 214.
My python COM server class:
class Controller:
_public_methods_ = [ <snip> ]
_reg_progid_ = "VPinMAME.Controller"
_reg_clsid_ = "{F389C8B7-144F-4C63-A2E3-246D168F9D39}"
_public_attrs_ = [ <snip>,
'Switch',
<snip>]
_readonly_attrs_ = [ <snip> ]
switch = [True]*128
lastSwitch = 0
def Switch(self, number):
return True
def SetSwitch(self, number, value):
return True
My client is a VB client. The issue occurs when the client issues the
following:
Controller.Switch(mSw(x)) = False
mSw is an array.
If I print mSw(x) before making the COM call, it prints out the expected
value, but if I print it out again after the call, mSw(x) is " ".
I'm assuming the parameter is being passed by reference and something on the
python side is corrupting it. To rule out the code that I used to have in
SetSwitch, I removed it all and now just return, but the corruption still
occurs.
Do I need to handle the params differently, or is this an issue with
win32com? The values of the params are the expected values; so I know the
values aren't getting corrupted on the way in.
Thanks.
- Gerry
*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20101129/85480658/attachment.html>
More information about the python-win32
mailing list