Thank Shortgrey!
but I don't know how my project has not worked yet, event I have done
anything as you guide
double[] x = new double[10];
double[] y = new double[10];
for (int i = 0; i < 10; i++)
{
x[i] = i;
y[i] = 10*i;
unsafe
{
fixed(double *xx = x)
fixed(double *yy = y)
myDllObj.SetData(xx, yy, 10, true);
}
The same error!
"Shortgrey" <no*****@please.fr> wrote in message
news:d3**********@news.tiscali.fr...
Hi Alex
you can try
double[] myArray = new double[10];
unsafe
{
fixed(double *myPtr = myArray)
SetData(myPtr, 10);
}
with "Allow unsafe code blocks" configuration enable.
Alex wrote: Hi All!
I have a dll, which is written in VC++.NET.
In the dll, I write a method like that
void SetData(double* array, int len)
....
then, I use this dll in a C#-Application, trying to pass
double[] myArray = new double[10];
MyObj.SetData(myArray, 10);
it posted an error: Can not convert from 'doublt[]' to 'ref double'.
Pls help me to solve this problem!
thanks!