❔ Need help with C#/C++ interop
I have a C++ dll (that I can't change or port to C#) that exports this function
I have some C# code that obtains a size, creates an input byte[] array holding "size" bytes of data and then creates an output byte[] array with new byte[size]. How would I declare my C++ function in C# and how would I then call it (passing in the byte arrays and size so the C++ dll gets what it expects, i.e. a pair of pointers to raw bytes it can read from and write to plus the size of those arrays)
4 Replies
pretty straight forward
to be more correct though, maybe
Ok thanks.
Also you can use
ref
s to avoid unsafe
context and specify data direction:
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.