Hi every body,
I'm working on Winform project in C# and I have to use a C written dll to communicate with an OpenVMS machine.
Some methods are using a C char** or an unsigned char** parameters
When i try to "translate" those parameters in string array, byte array or a StringBuilder and call thoses methods my software threw an AccesViolation.
I have the same problem when I replace thoses parameters with an IntPtr and use Marshal.Copy();
My software is build with the unsafe option.
Here an extract from the sources :
[DllImport("IPSecureClt.dll", EntryPoint = "IPSec_ListProjet")]
public static extern int IPSec_ListProject(
[In][Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPTStr)]
ref string[] cListProjects,int iNbElement, ref int iNbProjects);
);
Here the C declaration :
long IPSec_ListProjet(char cList[][256+1], const unsigned long lNbElement, unsigned long *lNbProjets);
How could I convert the "C" char** to a "C#" string array ?
Thanks for helping