Passing List<double> to a C++ Class Library from C#

J

jamie

hi,

I'm trying to pass a List<double> array from C# to a C++ class library
but I get the following error:
"No overload for method 'zzz' takes '1' arguments"

My C++ method in the library has 1 argument:
zzz(List<double> x)

and i'm calling it from C# with:
List<double> test = new List<double>();
test.Add(0.123);
objTest.zzz(test);

Any pointers/links to information on this topic would be appreciated

Jamie
 
W

Willy Denoyette [MVP]

You need a 'reference' type argument in C++/CLI, so change your code like
this.

zzz(List<double>^ x)

All you need to know is written in the Ecma-372 "C++/CLI Language
Specification" which can be found here: http://www.ecma-international.org/.

Willy.





| hi,
|
| I'm trying to pass a List<double> array from C# to a C++ class library
| but I get the following error:
| "No overload for method 'zzz' takes '1' arguments"
|
| My C++ method in the library has 1 argument:
| zzz(List<double> x)
|
| and i'm calling it from C# with:
| List<double> test = new List<double>();
| test.Add(0.123);
| objTest.zzz(test);
|
| Any pointers/links to information on this topic would be appreciated
|
| Jamie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top