Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning Cursors...
Message
 
 
To
29/08/2002 15:42:28
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00695065
Message ID:
00695159
Views:
16
>Ohhh, yes!!! Now I understand.
>
>COM Servers run as separate instances from VFP... So, an Array may be useful in my case?
>
>I'm trying NOT to use XML... boss don't want it. :(

You can use arrays but there will be problems because of the COM nature. You can't pass an array back directly. You have to use an object that has an array property. You can pass this back.

However, when the object is returned through the COM barrier, it gets converted to a COM array and VFP array functions no longer work on it. You will have to create methods as part of the return object to access the array. Ex.
define class CusReturn as Custom
dimension aValues[1]
narrlen = 1

procedure narrlen_access
return alen(THIS.aValues,1)
endproc
enddefine
Once the object has been populated and returned to VFP, you could do something like this:
local lxx, lox
lox = MyCOMCLass.ReturnSomeValues()
for lxx = 1 to lox.narrlen
   ? lox.aValues[lxx,1]
endfor
Internally the COM object can access the array using VFP array functions; externally they don't work. The Access method gives you the functionality to get the length of the array. With that, you can access the arrays values.

Good luck!
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform