I am writing my own wrapper around a managed component written in C ++ \ CLI.
I have the following function in managed code:
array<Byte>^ Class::Function();
I want to expose this function from a native C ++ class with the following signature:
shared_array<unsigned char> Class::Function();
I got to calling a managed function from within my own code, but I'm not sure how to safely copy a managed array to an unmanaged one.
gcroot<cli::array<System::Byte>^> managedArray = _managedObject->Function();
source share