I've run in to a little problem with COM, objects, and arrays.
Here's the scenario:
I've played around with passing arrays to COM objects, and much to my pleasant surprise, COMARRAY() works as adverstised. So I can say,
oCOM=CREATEOBJECT("mydll.myobject")
=COMARRAY(oCOM,11)
oCOM.populatearray(@myarray)
and myarray will be passed by reference and manipulatable.
HOWEVER,
say I have the following scenario:
I have an object with property myarray(1) from class myclass.
oMyObject=CREATEOBJECT("myclass")
oCOM=CREATEOBJECT("mydll.myobject")
oCOM.populateobject(oMyObject)
oMyObject is of course passed by reference, which is good. But oMyObject.myarray(1) is not seen by the COM object as an array - it seems to be passed by value. Trying to redimension the array of course causes an error. And COMARRAY of course is useless here since I'm not passing an array explicitly by reference.
Any one have any ideas or is this hopeless?
Eric Shaneson
Cutting Edge Consulting