Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is going on
Message
From
17/05/2002 16:55:54
John Baird
Coatesville, Pennsylvania, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
What is going on
Miscellaneous
Thread ID:
00658440
Message ID:
00658440
Views:
43
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?
Next
Reply
Map
View

Click here to load this message in the networking platform