Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create cursor from object (GATHER NAME on steroid
Message
 
À
05/03/2006 22:03:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01101568
Message ID:
01246810
Vues:
20
Hi Alejandro,

> It's as if you are looking at a proxy object that only gets properties added as they are discovered some other way.

That's pretty close... With a COM object you have two ways to get properties. First of all, a COM object can provide a type library. This library can be available either external as a TLB file, or be built into the COM object. The other way is called IDispatch. Basically, this means that VFP calls a particular method passing a name of a property or method. The COM object either returns an ID for this property or an error code if the property doesn't exist. VFP caches the result of these calls. So whenever you access a property for the first time, it gets added to the list of properties. Of course, you have to know the name first...

The type library access method has another gotcha. There's a COM call to access a type library. However, you need to make this call on the same object that you want to access a property on to get any meaningful result. In VFP this can cause problems when the object is apparently the result of a method call which is the case for arrays and collections. Hence, something like:
AMEMBERS(laPEM, loCOM.Folders(1).Item(1), 3)
might fail, whereas the following could work:
loItem = loCOM.Folders(1).Item(1)
AMEMBERS(laPEM, loItem, 3)
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform