Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing back an array
Message
De
05/10/1999 13:49:02
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00272758
Message ID:
00272815
Vues:
26
>>- Define the array in the calling object. The COM will access this array
>This doesn't seem to work for me either. For example:
>
>Calling program:
>DECLARE aDataset[1,1]
>oServer = CREATEOBJECT('VFPServer.GetData')
>
>In the VFPServer DLL's Init:
>SELECT * FROM inventory WHERE styleno='177' INTO ARRAY aDataset

That won't work because the DLL can't access the memory space of the calling program. You will need to pass the calling object to the COM:

*-- aDataset[1,1] need to be a property of the form/class
oServer = CREATEOBJECT('VFPServer.GetData', This)

In the VFPServer DLL's Init:

LPARAMETERS toParent
SELECT * FROM inventory WHERE styleno='177' INTO ARRAY toParent.aDataset


>>- Create a parameter object in wich you will create an array property. You will then pass this object back to the calling method
>How?

Create yourself a small class with no methods or properties. In your DLL:

loReturn = NewObject("MyClass", "MyLib")
loReturn.AddProperty("aDataSet[1, 1]")
SELECT * FROM inventory WHERE styleno='177' INTO ARRAY loReturn.aDataset
RETURN loReturn

Note that it may be preferable to create the class in the calling program and to pass the object to the COM that will populate it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform