Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MonoClass* monoClass = mono_class_from_name( monoImage, "Test", "TestClass" );
- MonoObject* monoObj = mono_object_new( monoDomain, monoClass );
- mono_runtime_object_init( monoObj );
- int handle = mono_gchandle_new( monoObj, false );
- MonoMethodDesc* monoMethodSetSomeValueDesc = mono_method_desc_new( "Test.TestClass::__internal_SetSomeValue", true );
- MonoMethod* monoMethodSetSomeValue = mono_method_desc_search_in_class( monoMethodSetSomeValueDesc, monoClass );
- int test = 1234;
- void* args[1];
- args[0] = &test;
- MonoObject* exc;
- MonoObject* testObj = mono_gchandle_get_target( handle );
- std::cout << "Test Obj: " << testObj << std::endl;
- mono_runtime_invoke( monoMethodSetSomeValue, mono_gchandle_get_target( handle ), args, &exc );
- mono_gchandle_free( handle );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement