#include "SecondNativeClass.h" using namespace System; namespace Vrp { public ref class BaseClass { public: ~BaseClass() SecondNativeClass* mysec; DoSomething() { mysec = new SecondNativeClass(); } . . . } }
#include "AnotherNativeClass.h" using namespace System; namespace Vrp { //class BaseClass; public class SecondNativeClass : public AnotherNativeClass { public: SecondNativeClass(); // I have try this gcroot<BaseClass^> base; //-> Returned errors // I tried that, but again errors; BaseClass* base; //-> Returned errors // I tried that, but again errors; BaseClass^ base; //-> Returned errors // I tried that like as on MSDN page (Mix Types Safely and Correctly) msclr::auto_gcroot<BaseClass^> base; //-> Returned errors . . . } }
ref
public
SecondNativeClass
gcroot
auto_gcroot
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)