.NET FrameworkPlatform Invoke


Syntax

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