导出的函数在vb.NET中形成C ++ dll

时间:2017-02-14 09:37:03

标签: c++ vb.net dll

我正在使用以供应商的C ++编写的非托管dll,我想在VB.NET中使用dll的导出函数来获取供应商设备的一些测量值。这对我来说是新的。我宣布时收到错误: 公共m_FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO为新FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO()

错误是:委托功能需要" AddressOf"表达式或lambda表达式作为其构造函数的唯一参数。您可以找到我此时使用的代码。

Public Delegate Function CB_ON_NEW_ANGLE_SERVO(ByVal nAngleMilliDegrees As Integer, ByVal dTimeStamp As Date, ByVal nStationNr As Integer, ByVal i64UserData As Long) As Boolean
Public Delegate Function FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO(ByVal fnc As CB_ON_NEW_ANGLE_SERVO) As Boolean

 Private m_FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO As New FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO()
 Private Function L3D_SET_CB_ON_NEW_ANGLE_SERVO(ByVal fcn As CB_ON_NEW_ANGLE_SERVO) As Integer
   If m_FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO Then
      Return m_FNC_L3D_SET_CB_ON_NEW_ANGLE_SERVO(fcn)
   Else
       Return 0
   End If
 End Function

0 个答案:

没有答案