vector of doubles - pinning

  • Thread starter Thread starter Henrique
  • Start date Start date
H

Henrique

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
 
Try this

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

Henrique said:
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
 

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

Back
Top