Re: FoxPro Interop by Josh
Josh
Tue Dec 30 14:41:24 CST 2003
If it works; then i guess I was badly mistaken.. thanks for letting me know it
does work by reference in VB to VFP.
On Tue, 30 Dec 2003 19:16:48 +0200, "Igor Korolyov" <k1i2v3@km.ru> wrote:
>Hi, Josh!
>You wrote on Mon, 29 Dec 2003 19:37:08 -0800:
>
>JA> You can't pass by reference.
>
>You mean VB? Or that VFP can't handle this?
>I don't have old VFP to test it there, but with VFP8 and VBA (I also don't
>have pure VB to test) there is NO problems at all:
>
>This is VFP code:
>
>=========Beginning of the aa.prg==============
>DEFINE CLASS test AS Custom OLEPUBLIC
>PROCEDURE ChangeValues
>LPARAMETERS tc1, tc2
> tc1 = m.tc1 + " changed"
> tc2 = m.tc2 + " changed"
> RETURN 1
>ENDPROC
>ENDDEFINE
>=========The end of the aa.prg================
>
>Compiled to multithreaded dll aa.dll
>
>This is VBA code:
>
>=========Beginning of the citation==============
>Sub testdll()
>Set o1 = New aa.test
>c1 = "string1"
>c2 = "string1"
>nResult = o1.ChangeValues(c1, c2)
>MsgBox (Str(nResult) & " " & c1 & " " & c2)
>End Sub
>
>=========The end of the citation================
>
>"aa Type Library" was added in tools/references...
>
>JA> Instead of trying to "return" values to the calling system; use class
>JA> properties and reference the properties to get the values you want.
>
>Yes, _sometimes_ it may work, and even may be recommended to simplify the
>code, but for example if you'll use COM+ and stateless componets that won't
>work at all :(
>
>[Sorry, skipped]
>
>P.S. Happy New Year
---
Remove x's to send.