473,396 Members | 2,010 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,396 software developers and data experts.

Delegates help

HI

Im trying to understand delegates in vb.net and the concept seems very
difficult.

is there a good study guide or something to help grasp this?

callback method?? signature?? Why does the delegate concept seem the
hardest in vb.net?

tia
Nov 21 '05 #1
1 1095
Hi Brad,

I agree and am also interested in what response you receive to this. I have
been trying to implement a delegate in my app. to return a dataset and for
the time being, I have given up :-(. I have decided to use threading.

However, I'll give you my resp. FWI.

A callback method is used to receive the result of the completed delegate
function. The delegate function must have the same signature (ie. pass same
params, and return same type) as the method whose reference it stores. I
suppose you could consider it as a 'shadow' function of the method it is
referencing.

So, the process I believe goes something like:-

Declare delegate with correct signature
Declare asyncallback (cbk)
Declare iAsynResult (iRes)

Instantiate delegate referencing the method that it is the delegate to: -
ie. delData = New DataDelegate(AddressOf myClass.FuncName)

Instantiate the callback method: - ie. cbk = New AsyncCallback(AddressOf
delDataComplete)

Start the process: - iRes = delData.BeginInvoke([param], cbk, Nothing)

Sub DataComplete (iRes as IAsyncResult)
Dim result as (Type) = delData.EndInvoke(iRes)
End Sub

HTH, Phil

"Brad Rogers" <br*************@yahoo.com> wrote in message
news:_eFVe.18668$vQ3.4589@trnddc08...
HI

Im trying to understand delegates in vb.net and the concept seems very
difficult.

is there a good study guide or something to help grasp this?

callback method?? signature?? Why does the delegate concept seem the
hardest in vb.net?

tia

Nov 21 '05 #2

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

Similar topics

6
by: Jeffrey T. Smith | last post by:
Back when the new J2SE1.5 features were announced, there was a JavaLive community chat (http://java.sun.com/developer/community/chat/JavaLive/2003/jl0729.html) in which Neal Gafter explains the...
1
by: Pablo Salazar | last post by:
Hi people. I found a book, it talked about oop, in a chapter i found a topic called "DELEGATES", I read it , but I didn't Understand. Somebody can tell me where I can find a tutorial or book that...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
14
by: Lior Amar | last post by:
Quick question about threads and delegates. I have the following scenario Thread A (CLASSA) spawns Thread B (CLASSB) and passes it a DelegateA to a callback Thread B Invokes a DelegateB...
4
by: AMDRIT | last post by:
I am trying to understand Delegates and where/when to use them. I can see one potential use of a delegate (on form closing, set the cancel property in the event arguments.) Does anyone have a...
5
by: vbgunz | last post by:
Hello everyone. I own two books. Learning Python and Python in a nutshell. When cross referencing the two books to try and clarify the ideas behind extending methods and delegates, this is where...
6
by: =?Utf-8?B?T2xkQ2FEb2c=?= | last post by:
My question is regarding the use of delegates in C#. I see how .Net uses delegates to wire event handlers to events. It’s an object created by a single line of code by the system and that makes...
69
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
4
by: Miro | last post by:
I am trying to understand delegates and I think I do understand them ... just hoping if someone can tell me im on the right track. So far what I have read is that a Delegate is an Asynchronus call...
3
by: David K in San Jose | last post by:
I'm using managed (CLR) C++ in VS2005 to create a Windows app that contains a form named "MyForm". In the code for that form I'm trying to invoke some static functions by using an array of function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...

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.