Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with an Array
Message
 
 
To
05/05/2002 10:53:10
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00649470
Message ID:
00652903
Views:
28
You can have an array property for internal use but for outside world it wouldn't look or behave as an array. That's why it's better to declare it PRIVATE or HIDDEN in the COM class. You can create special methods in COM object to access/modify that array. Please read thread I mentioned carefully one more time. Here's also some sample code.
oObj = Createobject("mydll.VFPArray")
oObj.SetArray()
DIMENSION laList[5]
oObj.GetArray(@laList)
RETURN

DEFINE Class VFPArray As Custom OlePublic
	DIMENSION aVar[1]
	PROTECTED aVar	

	PROCEDURE GetArray(aRetVal)
	EXTERNAL ARRAY aRetVal
	LOCAL x
	FOR x = 1 To Alen(This.aVar)
		aRetVal[x] = This.aVar[x]
	ENDFOR
	ENDPROC

	PROCEDURE SetArray()
	LOCAL x
	FOR x = 1 To Alen(This.aVar)
		DIMENSION This.aVar[x]
		This.aVar[x] = x
	ENDFOR
	ENDPROC
ENDDEFINE
>
>Thanks for the info.
>
>If we cannot have a array property in a COM Object then is there a workaround for it? How can we store multiple Object references in the COM Object?
>
>>See Thread #461092 for explanation.
>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform