passing IStream between managed & unmanaged code

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top