Groups | Blog | Home
all groups > vb.net upgrade > february 2004 >

vb.net upgrade : error "does not have the same signature as delegate"


john
2/4/2004 1:16:18 PM
Hello,

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

Method 'Public Function CamEventCallbackFunc(eventID As Integer, pData As
Integer, DataSize As Integer, Context As Integer) As Integer' does not have
the same signature as delegate 'Delegate Function
DelegateCDRegisterEventCallbackFunction(hSource As Integer, pFunc As
Integer, Context As Integer, ByRef hFunc As Integer) As Integer'.

Delegate Function DelegateCDRegisterEventCallbackFunction(ByVal hSource As
Integer, ByVal pFunc As Integer, ByVal Context As Integer, ByRef hFunc As
Integer) As Integer

Declare Function CDRegisterEventCallbackFunction Lib "CDSDK.dll" (ByVal
hSource As Integer, ByVal pFunc As DelegateCDRegisterEventCallbackFunction,
ByVal Context As Integer, ByRef hFunc As Integer) As Integer

err_Renamed = CDRegisterEventCallbackFunction(m_hSource, AddressOf
CamEventCallbackFunc, 100, m_hFunc)


john
2/4/2004 5:01:43 PM
Jay,

Here is the code

Public Function CamEventCallbackFunc(ByVal eventID As Integer, ByVal pData
As Integer, ByVal DataSize As Integer, ByVal Context As Integer) As Integer

m_CamEventID = eventID

CamEventCallbackFunc = cdOK

End Function



John

[quoted text, click to view]

Jay B. Harlow [MVP - Outlook]
2/4/2004 6:56:30 PM
John,
What does the declaration of the CamEventCallbackFunc function look like?

Is the last parameter ByRef or ByVal?

Hope this helps
Jay

[quoted text, click to view]

Jay B. Harlow [MVP - Outlook]
2/4/2004 10:11:10 PM
John,
The Context (4th parameter) on CamEventCallbackFunc is ByVal, the hFunc (4th
parameter) on DelegateCDRegisterEventCallbackFunction is ByRef.

You cannot mix ByVal with ByRef! They both need to be either ByVal or both
ByRef!

[quoted text, click to view]
Integer

[quoted text, click to view]

Hope this helps
Jay

[quoted text, click to view]

AddThis Social Bookmark Button