Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New COM Objects not working
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00266466
Message ID:
00266477
Views:
22
Your problem may stem from the assumption that the olepublic object is exposed to VFP. You may find that indeed the files are open in the olepublic objects datasession. You cannot expose the datasession to VFP in the normal manner. Try this.

In a method in the OLEPUBLIC object open one of your views. Assign the value of one of the fields to a property that you make available in the OLEPUBLIC object. You should also note that the olepublic object is not aware of your SET PATH, SET CLASSLIB etc.. commands.

DEFINE CLASS oMyData AS SESSION OLEPUBLIC
* Make this proerty available to show data
cMyExposedProperty = ""

PROCEDURE ExposeData
OPEN DATA +DatabaseName
SET DATA TO DatabaseName
USE lv_MyView IN 0 ALIAS ExposeCom
SELECT ExposeCom
This.cMyExposedProperty = ExposeCom.cMyFieldName
ENDPROC
ENDDEFINE

ox = CREATEOBJECT("MyApp.oMyData")
ox.ExposeData()

? ox.cMyExposedProperty

HTH
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net

If at first you don't succeed, then skydiving definitely isn't for you.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform