Jonathan Wilson
Jonathan Wilson
CC#
Created by Jonathan Wilson on 7/27/2023 in #help
❔ Need help with C#/C++ interop
I have a C++ dll (that I can't change or port to C#) that exports this function
void func(const unsigned char* in, unsigned char* out, int size)
void func(const unsigned char* in, unsigned char* out, int size)
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)
7 replies