473,799 Members | 3,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_WARNIN G: Add a delegate for AddressOf ViewFinderCallb ackFunc Click
for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?ke yword="vbup1048 "'

err_Renamed = CDStartViewfind er(m_hSource, 1, AddressOf
ViewFinderCallb ackFunc, 0)

Function

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

m_VFDataPtr = pBuf

ViewFinderCallb ackFunc = cdOK

End Function
Nov 20 '05 #1
2 1974
Hi,

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

Ken
---------------------
"john" <jo*********@ho tmail.com> wrote in message
news:Ok******** *****@tk2msftng p13.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_WARNIN G: Add a delegate for AddressOf ViewFinderCallb ackFunc
Click
for more:
'ms-help://MS.VSCC/commoner/redir/redirect.htm?ke yword="vbup1048 "'

err_Renamed = CDStartViewfind er(m_hSource, 1, AddressOf
ViewFinderCallb ackFunc, 0)

Function

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

m_VFDataPtr = pBuf

ViewFinderCallb ackFunc = 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 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)
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ua******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

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

Ken
---------------------
"john" <jo*********@ho tmail.com> wrote in message
news:Ok******** *****@tk2msftng p13.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_WARNIN G: Add a delegate for AddressOf ViewFinderCallb ackFunc
Click
for more:
'ms-help://MS.VSCC/commoner/redir/redirect.htm?ke yword="vbup1048 "'

err_Renamed = CDStartViewfind er(m_hSource, 1, AddressOf
ViewFinderCallb ackFunc, 0)

Function

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

m_VFDataPtr = pBuf

ViewFinderCallb ackFunc = 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
1235
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 String, ByVal cbCopy As Long) Private Function yDecEventHandler(ByVal MsgType As Long, ByVal Data As Long, ByVal Msg As Long, ByVal MsgSize As Long) As Long ' this function handles all events fired by the decoder library ' for most events,...
1
2845
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 lacking knowledge in. I would appreciate any help give with this. The main errors have to deal with the VarPtr and AddressOf expression. Unfortunetly I do not have much experience with delegates. Below is some of the code. I can produce the entire...
4
1955
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 iMsg As Integer, ByVal wParam As Integer, ByVal LParam As Integer) As Integer 'Code here
55
3334
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 call operations on Controls from a delegate, otherwise it does not work. However each time I've done an operation, I must update the progressbar and progresslabel, but this cannot be done in the delegate as it does not work.
9
1970
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 String) txtChat.AppendText(msg) End Sub I've never used a delegate or invoke before and I'm rather confused on the topic. Hope someone can help.
3
1406
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 implements member callbacks: typedef bool (__cdecl IEventHandler::*lbEvHandler)(IUnknown* uk);
0
343
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 any changes to a customer, and now I want to set a delegate up to Notify of any new customers. My problem is where to place it. With the Notify of changes it was simple because I just instantiate the Delegate after i create the customer object. ...
3
3576
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 example about using Routed Events, he has a loop that assigns an eventhandler to the PreviewKeyUp, etc., events, like this: //these are elements defined in code above this point UIElement els = { win, grid, btn, text }; foreach (UIElement el in els)
6
6873
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 ThreadStart(open)); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.