0

I have this function in CLI/managed C++ DLL

void Sim1::GetRes(array<double^,2>^ param1) 

And I call this function from C#

 double[,] param1 = new double[1000,2000];

 // fill the param1 array with values
 ...

 Sim1 sim1=new Sim1();
 sim1.GetRes(param1);

And I get this compiler error

Error   CS1503  Argument 2: cannot convert from 'double[*,*]' to 'System.ValueType[*,*]'    
3
  • Possible duplicate of passing multidimensional array from C# to C++ DLL Commented May 29, 2019 at 16:53
  • 1
    Delete the ^ from double, it is a value type. Commented May 29, 2019 at 17:00
  • @HansPassant Thanks! It works, please add the answer so I can choose your answer. Commented May 29, 2019 at 17:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.