473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Passing arguments to C++ class library

My application is written in C# and I'd like to pass 'double' array to managed C++ class library (which is a native C++ wrapper)
Of course the array should be passed by reference and not by value, therefore the C++ prototype is something like that
Void myFunc(double * myData

Since C# doesn't support pointer (in safe mode), I'm not sure what's the way for passing array of double ?
Maybe I have to change the C++ prototype for other arguments - I don't know!!

Any help would be much appreciated

Nov 16 '05 #1
3 1270
Maybe I have to change the C++ prototype for other arguments - I don't know!!.


If that's an option, yes. Change the signature to something like

void foo(double arg __gc[])

and it should appear as an array in the C# code.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
Thanks a lot Mattias, that would be great only if I could obtain arg address. (I need it for farther use as an argument to memcpy which takes void* )
If you could help me with that, it would be very helpfu

Thanks again

Nov 16 '05 #3

Thanks a lot Mattias, that would be great only if I could obtain arg
address. (I need it for farther use in this particular method) - if you
have any idea for that, it would be very helpful.

Thanks again.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4

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

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
17
by: Charles Sullivan | last post by:
The library function 'qsort' is declared thus: void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); If in my code I write: int cmp_fcn(...); int...
3
by: Philipp | last post by:
My application is written in C# and I'd like to pass 'double' array to managed C++ class library (which is a native C++ wrapper) Of course the array should be passed by reference and not by value,...
1
by: Hans [DiaGraphIT] | last post by:
Hi! I have problem with passing data to custom action. I don't know what wrong I'm doing. I'm trying to follow the steps in the walkthrough: "Passing Data to a Custom Action" ...
6
by: Max | last post by:
Last time I tried to explain this on another forum it didn't go too well, so I'll try my best and if you know what I'm talking about then please tell me how to do this. I have a class, inside I...
9
by: zholthran | last post by:
Hi folks, after reading several threads on this issue (-> subject) I fear that I got a problem that cannot easily be solved by the offered workarounds in an acceptable way, at least not with my...
0
by: Gonçalo Rodrigues | last post by:
Hi all, I have a single-rooted hierarchy of heap-allocated objects -- call the root Object. These objects are handled via a smart pointer template Reference<T>. Basically, Reference<Tis a...
8
by: MMAS | last post by:
Hey everyone -- Curious about some strange behaviour I'm seeing that seems to be related to my lack of understanding on how generics work in C#. Here's some simplified code (sorry for strange...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.