Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can make child abject available in OLE
Message
 
 
To
04/07/2003 16:09:05
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00807076
Message ID:
00807337
Views:
14
>I create an OLE PUBLIC object in vfp8, parent class custom.
>During runtime I add a collection class to the ole object via addobject in the dosomething method.
>The automation server runs fine but the client can not access new objects added to the ole server object.
>Is there a way to make child objects available to the client ?
>
>... access the server in scripting host or vb:
>
>' create the ole server
>set myole = createobject("oleserver.vfp8")
>' add the collection object mycollection in the dosomething method of vfp8
>myole.dosomething()
>msgbox myole.mycollection.name 'displays "mycustom.mycollection", ok
>
>msgbox myole.mycollection.count
>' generates an error, the count property can't be accessed
>
>thanks around

When defining your oleserver.vfp8, add a mycollection property in the clas definition. That way the property will be built into the interface. When you attempt to access the mycollection property, you should be able to. Because of VFP's late binding in this case, you should then be able to access the properties of whatever is stored in that property (in this case, a collection).

HTH.
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