So übergeben Sie ein Array von Doubles von C # an C ++ (DLL)
die C ++ - Funktionssignatur lautet:
int Eye_GetPositionSC2(std::string fname_mob, double sensors[9], int &map_x, int &map_y)
die C # -Funktionssignatur lautet:
[DllImport(@"eyeWhere.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern int Eye_GetPositionSC2([MarshalAs(UnmanagedType.LPWStr)]string filename, [In , MarshalAs(UnmanagedType.LPArray)]double[] sensors)
der Code wird gut kompiliert, aber es gibt eine "AccessViolationexception", während das doppelte Array an die Funktion übergeben wird.