473,545 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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(tes t);

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

Jamie
Mar 31 '06 #1
2 3928
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.

"jamie" <no@address.com > wrote in message
news:PZ******** ***********@new s20.bellglobal. com...
| 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(tes t);
|
| Any pointers/links to information on this topic would be appreciated
|
| Jamie
Mar 31 '06 #2
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.


thanks for the tip.
Jamie
Mar 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4722
by: Ivan Paganini | last post by:
Hello all. I'm trying to use a vector<double> to alocate de data that i need, and I am passing by reference to the function to receive the values. The code goes like this: //code void GenerateRandomPositions(vector<double>& posiX, vector<double>& posiY, int nbneurons, int* sizespace) {posiX.clear();
13
3273
by: Jalal | last post by:
I am trying to use numeric_limits<double>::min() in an MFC application in Microsoft Visual C++.NET 2003. I am having some difficulties here. The following are the parts of a simple program I wrote and corresponding error massages. I am confused here. Similar codes work fine in Win32 Console Project. Can you please help me to resolve this?...
2
1472
by: jamie | last post by:
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:
3
13914
by: Web learner | last post by:
The following code works fine private List<double> GetDataFor(string column, int selectedYear) { ------- ------- return list; } foreach (double item in GetDataFor("AirTemp", selectedYear)) { Response.Write(item.ToString() + ", ");
4
6200
by: Sin Jeong-hun | last post by:
List<List<T>a=param; List<List<T>b=a; If I change b, then a is get changed. I want another copy of a, that is completely independent of a. I used double-nested for loop to copy each element manually. Is there any more efficent way to do that? Something like, List<List<T>b=CreateClone(a); Thanks.
6
1549
by: janzon | last post by:
Hi I have a class Foo that I use both as a Foo<doubleand a Foo<float>. I want to put instances of this class in a list container. The list container itself is a template and need a type argument. The naive way below does not work. list<Bar<double>myList; It produces the error message: Error: "," expected instead of ">>". How
5
7159
by: J.M. | last post by:
I am trying to use a software package in my program, the problem being different methods are used to store vectors. I have "my" vectors stored as vector<doublefrom the STL and need to pass a double* and the dimension of the vector to the software package. On return, I get a double* plus dimension, but need vector<double>. Is there anyway that...
32
3953
by: T. Crane | last post by:
Hi, I'm struggling with how to initialize a vector<vector<double>> object. I'm pulling data out of a file and storing it in the vector<vector<double>object. Because any given file will have a large amount of data, that I read off using an ifstream object, I don't want to use the push_back method because this grows the...
0
2904
by: Marc Gravell | last post by:
Well, I'd have to wonder why you don't just use Dictionary<,/ SortedList<,/ SortedDictionary<,(and just use .Keys and .Values) But something like below: List<KeyValuePair<DateTime, double>list = null; List<DateTimekeys = list.Select(x =x.Key).ToList(); List<doublevalues = list.Select(x =x.Value).ToList(); List<doublevaluesByKey =...
0
7502
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7434
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7946
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.