Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP functions to be called from VB
Message
From
21/04/2005 10:22:33
Rakesh Pahwa
Symco Software P. Ltd.
Mumbai, India
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
VFP functions to be called from VB
Miscellaneous
Thread ID:
01006995
Message ID:
01006995
Views:
70
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

z = 'Hello'
Reply
Map
View

Click here to load this message in the networking platform