Information générale
Catégorie:
Codage, syntaxe et commandes
>>- 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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement