I have a pointer to a native class and want to temporarily wrap it in a Object. I assume the System::Reflection::Pointer::Box() function would be the way to go. However I’m having trouble formatting the second parameter to it.
class A {}
A * a;
Object ^ o = Box(a, A::typeid);
I get a runtime error that says ‘Type must be a pointer’, as I suppose it should be. But I cannot figure out the syntax.
I couldn’t get
System.Reflection.Pointer.Boxto work either, but found the capability to do what you are trying with humbleIntPtr.