Okay, A foxpro programmer I am not, however...I wrote a
class in vfp6. In this class I wrote a procedure that
accepts three parameters. I compiled the dll. I wrote
another app in VB6 that uses this class. Almost
everything works. My only problem is with my parameters.
I am trying to pass them by reference but I can't get it
to work (and not sure that it will at all), does anyone
have any thoughts on this? Could someone give me a
template of how I would pass parameters by ref? I have
seen the @ sign used, but I can't seem to get that to
work...may be it's because I'm using vfp6...

Thanks in advance.

Re: FoxPro Interop by Josh

Josh
Mon Dec 29 21:37:08 CST 2003

You can't pass by reference.

Instead of trying to "return" values to the calling system; use class properties
and reference the properties to get the values you want.

On Mon, 29 Dec 2003 15:52:15 -0800, "Chris Cappelletti"
<cappelletti@ttmtech.com> wrote:

>Okay, A foxpro programmer I am not, however...I wrote a
>class in vfp6. In this class I wrote a procedure that
>accepts three parameters. I compiled the dll. I wrote
>another app in VB6 that uses this class. Almost
>everything works. My only problem is with my parameters.
>I am trying to pass them by reference but I can't get it
>to work (and not sure that it will at all), does anyone
>have any thoughts on this? Could someone give me a
>template of how I would pass parameters by ref? I have
>seen the @ sign used, but I can't seem to get that to
>work...may be it's because I'm using vfp6...
>
>Thanks in advance.


---
Remove x's to send.

Re: FoxPro Interop by chris

chris
Mon Dec 29 22:34:57 CST 2003

That's helpful, I don't know how to implement class
properties in foxpro but I'm sure I can figure it out.
The only issue that I didn't mention is that I wanted to
pass an array...so I don't think it's possible...any
idea? What I have going now is I return a string
delimited with special characters for rows and columns,
then I made a wrapper class that would use the original
foxpro class to make a nice data table for use by other
applications...can you think of a better solution?


>-----Original Message-----
>You can't pass by reference.
>
>Instead of trying to "return" values to the calling
system; use class properties
>and reference the properties to get the values you want.
>
>On Mon, 29 Dec 2003 15:52:15 -0800, "Chris Cappelletti"
><cappelletti@ttmtech.com> wrote:
>
>>Okay, A foxpro programmer I am not, however...I wrote a
>>class in vfp6. In this class I wrote a procedure that
>>accepts three parameters. I compiled the dll. I wrote
>>another app in VB6 that uses this class. Almost
>>everything works. My only problem is with my
parameters.
>>I am trying to pass them by reference but I can't get it
>>to work (and not sure that it will at all), does anyone
>>have any thoughts on this? Could someone give me a
>>template of how I would pass parameters by ref? I have
>>seen the @ sign used, but I can't seem to get that to
>>work...may be it's because I'm using vfp6...
>>
>>Thanks in advance.
>
>
>---
>Remove x's to send.
>.
>

Re: FoxPro Interop by Igor

Igor
Tue Dec 30 11:16:48 CST 2003

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

--
WBR, Igor



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.