M
muntyanu
Hi all,
I am trying to pass array of ints to the method in .NET dll.
This is fragment of my code
// C++ side
int test[2] = new int[2] {1,2};
NETClass:oSomething(test,2);
// .NET side
public NETClass
{
public static void DoSomething([MarshalAs(UnmanagedType.LPArray,
SizeParamIndex=1)] int[] arr, int len )
{
// use arr[0], arr[1]
}
I am getting the compile error:
cannot convert parameter 1 from 'int [2]' to 'int __gc[]'
I would greatly appreciate any comment on this,
Roman
I am trying to pass array of ints to the method in .NET dll.
This is fragment of my code
// C++ side
int test[2] = new int[2] {1,2};
NETClass:oSomething(test,2);
// .NET side
public NETClass
{
public static void DoSomething([MarshalAs(UnmanagedType.LPArray,
SizeParamIndex=1)] int[] arr, int len )
{
// use arr[0], arr[1]
}
I am getting the compile error:
cannot convert parameter 1 from 'int [2]' to 'int __gc[]'
I would greatly appreciate any comment on this,
Roman