Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New COM Objects not working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00266466
Message ID:
00266477
Vues:
21
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform