Geeks With Blogs
It should just work... February 2012 Entries
C++ CLI - How to assign a gcroot instance to a stack based instance
So suppose I have:gcroot<SomeObject^> someObjectGCRoot;SomeObject someObjectOnTheStack;And I want to assign the gcroot object to the stack object.The solution is to declare the stack object as tracking reference instead of the raw type. So instead of:SomeObject someObjectOnTheStack;instead declare:SomeObject% someObjectOnTheStack;Then the conversion is easy:SomeObject^ someObjectHandle = static_cast<SomeObject^&... = *someObjectHandle; ......

Posted On Wednesday, February 15, 2012 2:12 PM

Copyright © cdpcodingblog | Powered by: