My C++ DLL have a function like this:
void func1(int& count, int* pValue);
this function will determine the “count”, and put some values into the pValue int array which is the length of “count”.
how can I define my C# code? you can ignor the [DllImport …] part.
thanks,
By ref
&isn’t going to happen as far as I’ve worked out.MSDN has the answers you seek
and don’t forget to export your function from C++ as
extern "C"According to MSDN: Default marshaling for arrays on the C# side I think you want something like the following
Where
SizeParamIndextells .net which argument will hold the size of the array to be marshaled.