I have a dll in c++, it returns list, I want to use it in my c# app as List
[DllImport("TaskLib.dll", SetLastError = true, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern List<int> GetProcessesID();
public static List<int> GetID()
{
List<int> processes = GetProcessesID();//It is impossible to pack a "return value": The basic types can not be packed
//...
}
Per Jared Par:
See:
Marshalling .NET generic types