Help with delegate addressOf

  • Thread starter Thread starter john
  • Start date Start date
J

john

Hello,

I am trying to convert from vb6 to vb.net and I have an issue with the
addressOf function. Below is the code any help would be greatly appreciated.
Thanks in advance.

code erroring here
'UPGRADE_WARNING: Add a delegate for AddressOf ViewFinderCallbackFunc Click
for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1048"'

err_Renamed = CDStartViewfinder(m_hSource, 1, AddressOf
ViewFinderCallbackFunc, 0)



Function

Public Function ViewFinderCallbackFunc(ByVal pBuf As Integer, ByVal Size As
Integer, ByVal Format_Renamed As Integer, ByVal Context As Integer) As
Integer

m_VFDataPtr = pBuf

ViewFinderCallbackFunc = cdOK

End Function
 
Ken,

Thanks for the reply. I did that and it resolved one of the four
AddressOf issues. The other three now have the following issue.

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)
 
Back
Top