.NET FrameworkPlatform Invoke


Sintassi

  • [DllImport ("Example.dll")] statico extern void SetText (string inString);
  • [DllImport ("Example.dll")] statico extern void GetText (StringBuilder outString);
  • [MarshalAs (UnmanagedType.ByValTStr, SizeConst = 32)] stringa di testo;
  • [MarshalAs (UnmanagedType.ByValArray, SizeConst = 128)] byte [] byteArr;
  • [StructLayout (LayoutKind.Sequential)] public struct PERSON {...}
  • [StructLayout (LayoutKind.Explicit)] struttura pubblica MarshaledUnion {[FieldOffset (0)] ...}

Platform Invoke Esempi correlati