Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM and Access/Assign
Message
From
14/10/1998 16:50:06
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
COM and Access/Assign
Miscellaneous
Thread ID:
00146877
Message ID:
00146877
Views:
76
I have created a COM object in VFP6.0 that has several properties with Access/Assign methods. When I use them from inside VFP they work fine. However, when I create the class as a COM object they do not seem to work at all.

For example, I have a "collection" which is an array of objects. The property containing the array has an access method which, when I call the collection using a name, redirects me to the proper numbered object, i.e.

LPARAMETERS nIndex1
IF VARTYPE(nIndex1)="C"
(Find the proper index number for the object)
nIndex1=(the proper index number for the object)
ENDIF
RETURN this.nIndex1


So I can say, Object.Collection("Name").property in code.

Using this as a COM object, I get the error, "Member COLLECTION does not evaluate to an object". But if I use the number for the index it works fine.

This makes it a little harder to write useful components. I know that there are components written in other languages that implement this behavior properly and I assumed that this was part of the point of Access/Assign.

I am assuming this is behavior by design or an oversight. If someone knows why this happens or if there is a workaround I would appreciate the help.

Eric Shaneson
Cutting Edge Consulting
Eric Shaneson
Cutting Edge Consulting
Next
Reply
Map
View

Click here to load this message in the networking platform