473,320 Members | 1,884 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,320 software developers and data experts.

Help me with delegates

I have been putting it off, but I think i need to become better versed in
delegates. I have been reading about them and I am unable to discern how to
use them or when to use.

It would seem to me, at least in one instance, that you would define a
delegate in a parent object to allow child objects to access in threaded
applications, code reusability, or as plain call-backs. But how.

Lets say you have a pop server class and a session class. The pop server
will want to know when a session authenticates so that it can prepare
information for the rest of the session. We need the pop server to complete
this task before completing the authentication process, but we do not want
the rest of the sessions to wait for this to complete. So I was thinking,
have the pop server perform the authentication, prepare information, return
the result.

public class popserver

'Create our delegate
public delegate function Authenticate(SessionID as string, UserName as
string, Password as string)

'Create our delegate handler
public function DoAuthenticate as Authenticate
return bResult
end function

end class
public class Session
'Consume our deleagate
'But how
end class
TIA
Nov 22 '05 #1
0 708

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

Similar topics

5
by: Anand Ganesh | last post by:
Hi All, I need some help. I am sort of not sure how to approach this problem. I have a MAINPROGRAM. This is the core application. I have asked two of my staff to developed two different...
8
by: Nicky Smith | last post by:
Hello, I'm reading Mike Gunderloy's Mcad Vb.net book, and I've also read the MS press Mcad book for the same topic ".. Windows based applications with VB.net" for exam 70-306. In the...
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...
2
by: RSH | last post by:
I have been looking at delegates lately. I have seen several articles explaining them but I'm having a hard time understanding why I would use a delegate over a traditional function or sub. Could...
0
by: Siegfried Heintze | last post by:
I'm practicing for the C# brain bench test by reviewing how delegates work. (Delegates are easy to to with visual studio because you normally use the delegates that some API as already defined. I'm...
13
by: Praveen | last post by:
trying to learn plymorphism. My sample is public class Class1 { public static void Main(string args) { Cls1 x = new Cls1(); Cls2 y = new Cls2(); Cls3 y = new Cls3();
5
by: sajin | last post by:
Hi All.. We are using VB .Net 2005 for implementing an API. API needs to generate events. For this client wants us to use Windows Callback (delegate implementation). The intention of using...
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...
2
by: hcaptech | last post by:
This is my Test.can you help me ? 1.Which of the following statement about C# varialble is incorrect ? A.A variable is a computer memory location identified by a unique name B.A variable's name...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.