Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DllExport and passing parameters by reference
Message
De
30/11/2016 04:52:50
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01644109
Message ID:
01644125
Vues:
25
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I am wondering if anyone of you has experience making C# dll to be accessible from VFP using DllExport utility. In particular, I am interested in passing parameters by reference.
>
>I made a simple function in C#
>
>
>[DllExport("CheckParamsByRef", System.Runtime.InteropServices.CallingConvention.StdCall)]
>        /// <summary>
>        /// CheckParamsByRef
>        /// <param name="test">The string to return by reference</param>
>        public static int CheckParamsByRef(ref String test)
>        {
>            test = "Hello from C#";
>            return 1;
>        }
>
>
>and try to call it from VFP
>
>
>DECLARE integer CheckParamsByRef IN "MyDLL x86.dll" ;
>    string @ 
>ReturnValueText = ""
>    ? CheckParamsByRef(@ReturnValueText)
>    ? 'ReturnValueText: ' + ReturnValueText
>
>On the ? CheckParamsByRef call I'm getting exception from DLL.
>
>Does it mean we can not use DllExport and passing parameters by reference? Is there any way around the problem?
>
>Thanks in advance.

Why bother exporting? AFAIR you can use standard interop and get the DLL by using CreateObject() in VFP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform