I\'m trying to send an image from C++ to C# with an interop (marshaling) of C++ managed. image->getStream() return a const char* from a string.<
image->getStream()
const char*
I wouldn't use Marshal::Copy. Since you have the array locally, why not just pin it and use memcpy?
memcpy
pin_ptr<Byte> ptrBuffer = &byteArray[byteArray->GetLowerBound(0)];
You can now call memcpy to ptrBuffer.
ptrBuffer
When the scope ends the pinning is automatically undone.