Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM, objects, parameters, and arrays
Message
From
12/11/1998 16:53:29
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
COM, objects, parameters, and arrays
Miscellaneous
Thread ID:
00157192
Message ID:
00157192
Views:
63
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
Reply
Map
View

Click here to load this message in the networking platform