我在 c++ 中有一个 dll,它返回列表,我想在我的 c# 应用程序中使用它作为列表
[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
//...
}