Hello,
I have few questions about using dll (unmanaged) with c#
I have a class "DLLCommunication" where I declare DLLImport :
[DllImport(@"D:\0_Projet\INERIS\DLL_Communication\sources dll\Debug\Lcv31.dll", CallingConvention = CallingConvention.Cdecl)]
public extern static int INIT_COM_RS232(ref int Handle, int NoCom, int Vitesse);
[DllImport(@"D:\0_Projet\INERIS\DLL_Communication\sources dll\Debug\Lcv31.dll", CallingConvention = CallingConvention.Cdecl)]
public extern static int INIT_DIALOG(int Handle, ref STATION Station, ref Boolean Unused);
however in the DLL some data are statics (and global) and so each time I use INIT_COM_RS232 or INIT_DIALOG (for example : int initialisationCommunication = DLLCommunication.INIT_DIALOG(station.ConnexionSerie.Handle, ref stationStruct, ref booleen);) all static variables are erased.
Is there any way to keep "DLL context" and avoid to erase all static variables each time I need to call the DLL ? (I can't modify the DLL)