Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Calling VFP function by reference from VB
I have created a function which requires 3 parameters, 2 by value and one by reference.
This has been compiled as a DLL file.
While calling this function from VFP I pass on the third parameter by @ prefixed to it and the function returns with the value of third parameter updated.
Now I want to deploy this DLL from VB. By default the declaration of SUB in VB requires the calling methodolgy to be announced as BYREF or BYVAL. However the calling statement does not seem to have the option.
e.g. VFP function
Local mystr = 'Hello'
? myfunction(5,4,@mystr) => 9
? mystr => "Hello World"
Define Class MyClass
MyFunction(a,b,c)
result = a+b
c = c + " World"
Return result
END DEFINE
In VB
Registered MyDll.dll
Dim Mystr = "Hello"
Dim myobject = mydll.myclass
myobject.myfunction(5,4,Mystr) does not change the value of mystr
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