473,326 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Help with delegate addressOf

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
Nov 20 '05 #1
2 1955
Hi,

Maybe this will help.
http://www.elitevb.com/content/01,0075,01/04.aspx

Ken
---------------------
"john" <jo*********@hotmail.com> wrote in message
news:Ok*************@tk2msftngp13.phx.gbl...
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

Nov 20 '05 #2
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)
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
Hi,

Maybe this will help.
http://www.elitevb.com/content/01,0075,01/04.aspx

Ken
---------------------
"john" <jo*********@hotmail.com> wrote in message
news:Ok*************@tk2msftngp13.phx.gbl...
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


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: William Morgan | last post by:
Public Declare Sub ydec_set_callback Lib "yDecLib.dll" (ByVal CallbackFunc As Long) Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal lpvDest As String, ByVal lpvSource As...
1
by: john | last post by:
Hello, I am trying to convert a project from vb6 to vb.net. The code is a sample from an sdk for Canon digital camera's. I have gotten most of the issues resolved, but there are some that I am...
4
by: ItsMe | last post by:
Hi Guyz, I'm unable to understand this (AddressOf) error??? In VB6 I have two functions: ---------------------------- Public Function ImageFirstImageCallback(ByVal hWnd As Integer, ByVal...
55
by: Sam | last post by:
Hi, I have a serious issue using multithreading. A sample application showing my issue can be downloaded here: http://graphicsxp.free.fr/WindowsApplication11.zip The problem is that I need to...
9
by: Terry Olsen | last post by:
I'm running an asynchronous Socket. In the ReceiveCallback method, I need to append what is received to a textbox on the main form. I have this code: Private Sub ToChatWindow(ByVal msg As...
3
by: lothar.behrens | last post by:
Hi, I am thinking about the delegate mechanism and try to understand it. I am coming from C++ and know about callbacks or member callbacks. In C++ I have this typedef for every class that...
0
by: RSH | last post by:
I am rather new to delegates and I was working through an exersize. I have created a simple commandline project that basically adds or edits customers. I am using two delegates, one to Notify...
3
by: RobinS | last post by:
I'm trying to learn WPF and do it in VB instead of C#. (God forbid I should do *anything* the easy way. ;-) Here's something weird. On p162-3 of this book by Petzold (in C# of course) in an...
6
by: Sergey Poberezovskiy | last post by:
I have the following code in C# that I have trouble converting to VB(2.0): private delegate void openDialog(); private void openWindowsDialog(openDialog open) { Thread thread = new Thread(new...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.