static void Main(string[] args) { var obj = new TestFnParams { PropertyA = 100, PropertyB = "Hello from managed object" }; TestFunction(obj); Console.Read(); }
public static extern void TestFunction([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CustomMarshaler))] TestFnParams p);