I want to store a pointer to a native class in System::Object^ and retrieve it back.
class ABC;
ABC * d = new ABC();
System::Object^ Tag;
Tag = d; //This throws an error
//in a different function
ABC * c = safe_cast<ABC*>Tag; // this throws an error.
Which is the proper way to achieve the above behavior?
Use IntPtr structure instead of Object.