環境: windows 10 + visual studio 2017 C#
LavView Dll: LabView 2014 輸出的DLL
DLL Prototype :
到C#中的函數引用:
[DllImport(“ReadEEPROMDataLib.dll”)]
unsafe public extern static Int32 ReadEEPROMData([MarshalAs(UnmanagedType.LPWStr)] string Interface, float* R, float* d, float* c, float* b, float* a, Int32* ReadTimes, [MarshalAs(UnmanagedType.LPWStr)] string TrackingNumber15Digits, Int32 len);
實際使用函數:
unsafe
{
string InterFace = "CAN1";
string TrackingNumber15Digits = "000000000000000";
float R, D, C, B, A =0;
float* r = &R;
float* d = &D;
float* c = &C;
float* b = &B;
float* a = &A;
int Readtime = 50;
int* RT = &Readtime;
int len = 15;
int re = ReadEEPROMData(InterFace, r, d, c, b, a, RT,TrackingNumber15Digits, len);
}
發生的錯誤如下:
請問,我要如何正確地引用 來自 LabVIEW的DLL?
謝謝