private static int CreateAndInvoke(string parameter)
 {
     IntPtr ptr = new IntPtr();
     var debugDelegate = GetDebugDelegate(ptr, typeof(MyDelegate), typeof(MyClass));
     var instance = new MyClass();
     object[] parameters = { instance, parameter };
     var res = (int)debugDelegate.DynamicInvoke(parameters);
     //cppResult = (int)parameters[1];
     return res;
 }
Пример #2
0
 private static int Invoke(MyClass instance, string parameter)
 {
     return instance.Invoke(parameter);
 }