I\'ve got a library in C which I\'d like to use from C#.
From what I\'ve gleaned off the internet, one idea is to wrap it in a C++ dll, and DllImport that.
This is how I typically interact with C DLLs from C#:
public static unsafe class WrapCDll {
private const string DllName = "c_functions.dll";
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern void do_stuff_in_c(byte* arg);
}
No need to wrap in C++ and you get the needed calling convention.