Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How send ref parameter to VFP COM method?
Message
De
12/01/2004 19:18:03
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00866186
Message ID:
00866208
Vues:
19
Kelly,

You need to use the "@" to indicate passing by reference in your VFP method definition. So, it'd be like this:
  PROCEDURE TestMe( TestString AS String @ ) AS String
~~Bonnie


>If I have a COM DLL built in VFP8 where a class method contains this signature:
>
>
>  PROCEDURE TestMe( TestString AS String ) AS String
>
>
>Once I have imported the DLL reference into .NET and created an object reference in C# code, how can I call that method and pass the parameter by ref so that I can work with the value that is "returned"? My project compiles and runs without error when the line in question looks like this, but my TestString variable remains blank after the call because (I assume) it was passed by value.
>
>
>  string TestString = "";
>  oTest.TestMe( TestString );
>
>
>If I change that C# line to this, I get a compile error saying that a ref string cannot be converted to a string.
>
>
>  string TestString = "";
>  oTest.TestMe( ref TestString );
>
>
>Is there something that needs to (and can) be done in the VFP method or resulting DLL that will indicate in the typelib that the parameter can be passed by reference? I feel like I should know the answer to that, but I've beat my head a few times and nothing good has fallen out so I figured I'd ask here. Thanks.
>
>Kelly
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform