Call by Reference Problem
-
I m trying to use Method where arguments are pass by reference of Managed C++ Code in C#.But the error is coming like: The best overloaded method match for 'ManagedDLL.Class1.BoxPropertiesMG(double, double, double, double*, double*)' has some invalid arguments cannot convert from 'ref double' to 'double*' Source Code for this is given below: //Managed C++ Dll Code: public __gc class Class1 { public: void BoxPropertiesMG(double L, double H, double W, double& A, double& V) { BoxProperties(L, H,W, A, V); } }; C# Code: class Class1 { static void Main(string[] args) { ManagedDLL.Class1 ob = new ManagedDLL.Class1(); double L=2.0, W=3.0, H=4.0; double A, V; Console.WriteLine(ob.BoxPropertiesMG(L,H,W,ref A, ref V)); } } Can Someone help me to solve this problem ?
-
I m trying to use Method where arguments are pass by reference of Managed C++ Code in C#.But the error is coming like: The best overloaded method match for 'ManagedDLL.Class1.BoxPropertiesMG(double, double, double, double*, double*)' has some invalid arguments cannot convert from 'ref double' to 'double*' Source Code for this is given below: //Managed C++ Dll Code: public __gc class Class1 { public: void BoxPropertiesMG(double L, double H, double W, double& A, double& V) { BoxProperties(L, H,W, A, V); } }; C# Code: class Class1 { static void Main(string[] args) { ManagedDLL.Class1 ob = new ManagedDLL.Class1(); double L=2.0, W=3.0, H=4.0; double A, V; Console.WriteLine(ob.BoxPropertiesMG(L,H,W,ref A, ref V)); } } Can Someone help me to solve this problem ?