I know only very little about C++/CLI, but I have a simple problem that needs a solution. I have a C++/CLI class method that takes a byte-array as a parameter. The array is of a pre-determined length, and can be allocated in C# beforehand. The array is supposed to be filled with data by the C++/CLI method.
How do I declare the method and then call it from C#?
I tried something like having the following in my C++/CLI class:
public ref class C
{
public:
void FillBytes(array<BYTE^>^ bytes);
};
And then, in C#:
o = new C();
var bytes = new byte[3];
o.FillBytes(bytes);
But that didn't work at all :).