Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is going on
Message
 
To
17/05/2002 16:55:54
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00658440
Message ID:
00658444
Views:
14
This will not work in a DLL But check out the function ComArray() Assuming you are using VFP7

>Okay guys:
>
>I start with this class:
>
>
>DEFINE CLASS testarray AS line
>
> FUNCTION getList()
> loObj = NEWOBJECT('line')
> loObj.AddProperty('aList(1,3)', '')
>
> SELECT lname, fname, cust_id ;
> FROM customer ;
> INTO ARRAY loObj.aList
>
> RETURN loObj
> ENDFUNC
>ENDDEFINE
>
>
>which I call like this from a program:
>
>---------------------------------------------
>set procedure to testarray
>o = createobject('testarray')
>x = o.getlist()
>
>?ALEN(x.aList, 1)
>
>FOR EACH oItem IN x.aList
> ? oItem
>ENDFOR
>
>--------------------------------------------
>
>
>Everything works fine, but if I do this as a dll:
>
>
>----------------------------------------------
>DEFINE CLASS Customer AS SESSION OLEPUBLIC
>
> FUNCTION getList()
> loObj = NEWOBJECT('line')
> loObj.AddProperty('aList(1,3)', '')
>
> SELECT lname, fname, cust_id ;
> FROM customer ;
> INTO ARRAY loObj.aList
>
> RETURN loObj
> ENDFUNC
>ENDDEFINE
>----------------------------------------------------
>
>and then try to access it:
>
>
>o = CREATEOBJECT("libs.Customer")
>x = o.GetList()
>
>?ALEN(x.aList, 1)
>
>FOR EACH oItem IN x.aList
> ? oItem
>ENDFOR
>------------------------------------------------------
>
>I get all kinds of errors: it doesn't recognize x.alist as an array. What do I need to do so it does?
Previous
Reply
Map
View

Click here to load this message in the networking platform