We recommend using Visual Studio 2017

auto_gcroot Class


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at auto_gcroot Class.

Automatic resource management (like auto_ptr Class) which can be used to embed a virtual handle into a native type.

template<typename _element_type>  
class auto_gcroot;  


The managed type to be embedded.

Header file <msclr\auto_gcroot.h>

Namespace msclr

auto_gcroot Members
How to: Declare Handles in Native Types
auto_handle Class