marshal_context Class
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

marshal_context Class

This class converts data between native and managed environments.

class marshal_context

Use the marshal_context class for data conversions that require a context. See Overview of Marshaling in C++ for more information about which conversions require a context and which marshaling file has to be included. The result of marshaling when you use a context is valid only until the marshal_context object is destroyed. To preserve your result, you must copy the data.

The same marshal_context can be used for multiple data conversions. Reusing the context in this manner will not affect the results from previous marshaling calls.

Header file: <msclr\marshal.h>, <msclr\marshal_windows.h>, <msclr\marshal_cppstd.h>, or <msclr\marshal_atl.h>

Namespace: msclr::interop

© 2015 Microsoft