我想从 C# PInvoke 用 VB6 编写的函数。我们可以像这样在VB6中调用这个函数:
Declare Function ApplyNNet Lib " location of the DLL file" (MyNNetType As String, MyAddress As String, MyInput() As Double) As Variant
我在 C# 中的代码是:
[DllImport("NNetApply.dll", EntryPoint = "ApplyNNet", CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr ApplyNNet(string type, string add, double[,] data);
//run ANN with data
string address = @"C:\Users\PNGE-User\Desktop\Faegheh\Project\Neural Network For Pressure Vs q,x,y\P ve x,y,q\P ve x,y,q";
double[,] P = new double[no_data,2];
var P_ = ApplyNNet("Back Prop", address, data);
当我调试我的代码时,会出现一个错误:
尝试读取或写入受保护的内存。这通常表明其他内存已损坏。