Ticket #35 (assigned Defect: null)

Opened 6 years ago

Last modified 6 years ago

VBScript can't assign individual array elements of list property exposed through COM

Reported by: jjr8 Owned by: jjr8
Priority: Medium Milestone: Unscheduled
Component: Core - COM Interop Version: 0.2
Keywords: Cc:

Description

If a COM-exposed class exposes a read/write property that is a list of integers, VBScript can't assign individual array elements, like this:

v1 = obj.IntegerListProperty
obj.IntegerListProperty(0) = 10

This is supposed to assign element 0 to the value 10. In this case, VBScript calls InvokeEx like this:

2007-01-09 16:14:14,186 DEBUG COM object 0x01A3B910: InvokeEx called: dispid = 3 (IntegerListProperty), lcid = 1033, wFlags = 4 (DISPATCH_PROPERTYPUT), args = (0, 10), kwArgs = None, serviceProvider = <PyIServiceProvider at 0x1a247b4 with obj at 0x3dfc8>

VBScript passes in two parameters, the index and the value. Pythoncom passes this as a tuple to the fset method, like this: args = (0, 10). The fset method thinks the caller is assigning a new array with two elements, rather than trying to set the value of an element in the existing array.

I need to figure out how to expose array properties properly.

Change History

Changed 6 years ago by jjr8

  • status changed from new to assigned
  • component changed from Base Modules to COM Interoperability

Changed 6 years ago by jjr8

  • version set to MGET 0.2
  • milestone changed from MGET 0.1 to MGET 0.3

Changed 6 years ago by jjr8

  • type changed from Task to Defect
  • milestone changed from 0.3 to Unscheduled
Note: See TracTickets for help on using tickets.