473,387 Members | 1,882 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,387 software developers and data experts.

vector of doubles - pinning

Hi

Kind of newbie question:

We have a DLL with a function with a prototype like

void mult( int mtxhandle, double* x, double* y, int size );

where "size" is the size of both x and y vectors. What should be the correct
sintax to define its respective DllImport wrapper in order to use it (in C#)
like:

Double x[] = new Double[mysize];
Double y[] = new Double[mysize];

mult( handle, x, y, mysize );

Thank you

Henrique

Nov 16 '05 #1
2 1536
Try this

[DllImport("mydll.dll")]
private static extern void (int mtxhandle, ref double x, ref double y, int
size);

--
Shak
(Houston)
"Henrique" <he************@hotmail.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
Hi

Kind of newbie question:

We have a DLL with a function with a prototype like

void mult( int mtxhandle, double* x, double* y, int size );

where "size" is the size of both x and y vectors. What should be the correct sintax to define its respective DllImport wrapper in order to use it (in C#) like:

Double x[] = new Double[mysize];
Double y[] = new Double[mysize];

mult( handle, x, y, mysize );

Thank you

Henrique

Nov 16 '05 #2
Hi,

"Henrique" <he************@hotmail.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
Hi

Kind of newbie question:

We have a DLL with a function with a prototype like

void mult( int mtxhandle, double* x, double* y, int size );
protoype:

[DllImport(...)]
public extern static mult( int mtxhandle, double[] x, double[] y, int
size );

call:
double[] x = new double[mysize];
double[] y = new double[mysize];
mult( handle, x, y, mysize );
HTH,
greetings

where "size" is the size of both x and y vectors. What should be the correct sintax to define its respective DllImport wrapper in order to use it (in C#) like:

Double x[] = new Double[mysize];
Double y[] = new Double[mysize];

mult( handle, x, y, mysize );


Thank you

Henrique

Nov 16 '05 #3

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

Similar topics

9
by: {AGUT2}=IWIK= | last post by:
Hello all, It's my fisrt post here and I am feeling a little stupid here, so go easy.. :) (Oh, and I've spent _hours_ searching...) I am desperately trying to read in an ASCII...
12
by: BCC | last post by:
If I create a vector of vectors of double: std::vector< std::vector<double> > table1; Are my vectors of doubles uninitialized? Do I have to loop through table1 and initialize each vector of...
8
by: Markus Dehmann | last post by:
I am wondering what is the "best" code to print out the elements of a vector. Assume they contain strings. With "best", I mean shortest and most readable at the same time. Of course, a for...
14
by: LumisROB | last post by:
Is it possible to create matrixes with vector <vector <double >> ? If it is possible which is the element m23 ? You excuse but I am not an expert Thanks ROB
2
by: fred_stevens | last post by:
Hi all you C boffins: I need to sort a vector of doubles is ascending order. Qsort will return the sorted vector, but I need a vector of the indices of the sorted vector, not the actual sorted...
4
by: Henrique Bucher | last post by:
Hi Kind of newbie question: We have a DLL with a function with a prototype like void mult( int mtxhandle, double* x, double* y, int size ); where "size" is the size of both x and y...
1
by: Raghuram N K | last post by:
Hi, Following program compiles and executes successfully in windows with DevCPP compiler. When I compile the same in Linux with 'g++323' compiler I get following assignment error: cannot...
12
by: DaTurk | last post by:
Hi, I have a rather interesting problem. I have a unmanged c++ class which needs to communicate information to managed c++ via callbacks, with a layer of c# on top of the managed c++ ultimatley...
4
by: Christian Schmidt | last post by:
Hi all, I'm trying to implement a std::vector-like wrapper for IList. The hard part seems to be operator, because it returns an unmanaged reference. Probably I have to use pin_ptr to achieve this,...
4
by: Anonymous | last post by:
I ahve a vector of doubles taht I need to extract values from. I was just about to use the STL find() algo, but I have a couple of questions: first: can you specify the tolerance threshold to...
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
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.