get pointer on byte array from unmanaged c++ dll in c#
问题 in c++ I have such function extern "C" _declspec(dllexport) uint8* bufferOperations(uint8* incoming, int size) I am trying to call it from c# like this [DllImport("MagicLib.DLL", CallingConvention = CallingConvention.Cdecl)] //[return: MarshalAs(UnmanagedType.ByValArray)]//, ArraySubType=UnmanagedType.SysUInt)] public static extern byte[] bufferOperations(byte[] incoming, int size); But I get the Cannot marshal 'return value': Invalid managed/unmanaged type combination ((( The question is -