用VC编译的DLL文件,然后用VB.NET调用函数时 报错 “尝试读取或写入受保护的内存。这通常指示其他内存已损坏”
声明
Public Declare Function DP_OutpB Lib "DirectPort.dll" ( ByVal dSetFr As Integer ) As Double
什么意思啊?
------解决方案--------------------
通常出现这样的情况是多个方法尝试对一个流或者文件进行读写所致。
------解决方案--------------------
c++
double FastTestFr(double dSetFr, double dStartBias, double dStopBias, double dFastStep, double dTestStep,int nADValidLimt, int nADPhaseLimit, int nFastDelay,int nDelayTimes, float fPower,float fRr);
vb.net
Public Declare Function DP_OutpB Lib "DirectPort.dll" ( ByVal dSetFr As Integer ) As Double
明显的参数不对应
------解决方案--------------------
Public Declare Function FastTestFr Lib "DirectPort.dll" (ByVal dSetFr As Double, ByVal dStartBias As Double, ByVal dStopBias As Double, ByVal dFastStep As Double, ByVal dTestStep As Double, ByVal nADValidLimt As Integer, ByVal nADPhaseLimit As Integer, ByVal nFastDelay As Integer, ByVal nDelayTimes As Integer, ByVal fPower As Single, ByVal fRr As Single) As Double
------解决方案--------------------
那就是VC函数的问题了。
------解决方案--------------------