Hi,
I'm afraid I may have confused things with my last message. You should be able to pass strings by reference. The following works. VFP:
DEFINE CLASS StringTest AS CUSTOM OLEPUBLIC
FUNCTION ChangeString (cReceivedString AS STRING @)
cReceivedString = "Hello World"
ENDFUNC
ENDDEFINE
C#:
static void Main(string[] args)
{
string s = "Input String";
interop.StringTestClass i = new interop.StringTestClass();
i.ChangeString(ref s);
}
Note I should has specified cReceivedString AS 'STRING @' not 'VARIANT @'
HTH,
Viv
>I think I have thgis working now, thanks for your help.
>In VS, I initially had param2 as a string and it was complaining
>I chnged to:
>object param2
>param2="abc";
>MyVFP(string param1, ref param2)
>mytextControl.Text x=param2.Tostring();
>
>..and it seems to work fine now and is returning the value from VFP
>Obviously for Return parameters, they have to be defined as objects