请教C#调用MFC动态链接库的问题
现有一C++6.0的dll文件,其调用函数原型为:double * filtereddata(double *src,int filterstye=1)我在C#中该如何写其调用函数,
我在声明中使用的是:
[DllImport("sigproc.dll", EntryPoint = "filtereddata", SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
unsafe public static extern double[] filtereddata(double* src, int filterstye);
调用时:{
double[] d = new double[2500];
for (int j = 0; j < 10; j++)
{
for (int ii = 0; ii < 250; ii++)
{
d[i] =Math.Sin(Math.PI * (double)2 *ii / (double)250);
//MessageBox.Show(d[i].ToString());
}
}
fixed (double* k = d)
{
double[] mm = filtereddata(k, 1);
}
}
出错!
[ 本帖最后由 xxp5310776 于 2010-5-24 10:43 编辑 ]