Ticket #35 (assigned Defect: null)
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.
