Does anyone know this?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john

    #1

    Does anyone know this?

    Hello,

    I am trying to create a delegate for an upgrade but I am now getting
    this error:

    Method 'Public Function CamEventCallbac kFunc(eventID As Integer, pData As
    Integer, DataSize As Integer, Context As Integer) As Integer' does not have
    the same signature as delegate 'Delegate Function
    DelegateCDRegis terEventCallbac kFunction(hSour ce As Integer, pFunc As
    Integer, Context As Integer, ByRef hFunc As Integer) As Integer'.

    Delegate Function DelegateCDRegis terEventCallbac kFunction(ByVal hSource As
    Integer, ByVal pFunc As Integer, ByVal Context As Integer, ByRef hFunc As
    Integer) As Integer

    Declare Function CDRegisterEvent CallbackFunctio n Lib "CDSDK.dll" (ByVal
    hSource As Integer, ByVal pFunc As DelegateCDRegis terEventCallbac kFunction,
    ByVal Context As Integer, ByRef hFunc As Integer) As Integer

    err_Renamed = CDRegisterEvent CallbackFunctio n(m_hSource, AddressOf
    CamEventCallbac kFunc, 100, m_hFunc)


  • Mattias Sjögren

    #2
    Re: Does anyone know this?


    Make sure the CamEventCallbac kFunc method signature ends with

    ...., ByRef hFunc As Integer) As Integer

    rather than

    ...., ByVal hFunc As Integer) As Integer



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...