passing IStream between managed & unmanaged code

  • Thread starter Thread starter vcquestions
  • Start date Start date
V

vcquestions

Hi. What's the most efficient way to pass streams between managed &
native code.

I need to pick up a stream from C# & pass it to c++/cli for some
native operations in the form of IStream. I then need to pass the
updated stream back to c# side.

Would I be better off with:

1 ) dealing with InteropServices.ComTypes.IStream
2 ) read file into an array of bytes on the c# side. On the c++/cli
side Marshal it to Native array and create stream on memory. After
updating the native IStream, convert it back to array of bytes via
marshalling & pass it to c# code.

Thanks in advance!
vcq
 
Back
Top