I need to do some strange things with gcroot, but I get the following error in the dynamic line: “cannot use dynamic_cast” to convert from “gcroot” to “IMyInterface ^". In C #, you could easily dump a shared object to any interface: You may receive a runtime error if the object does not implement the interface, but it will be compiled.
gcroot<Object^> m_pDataObject;
IMyInterface obj = dynamic_cast<IMyInterface^>(m_pDataObject);
source
share