?
Solved

Question about program flow and event handlers

Posted on 2009-04-16
3
Medium Priority
?
382 Views
Last Modified: 2012-05-06
Hi

Lets say I have a method that raises an event by called the INvoke method of a delegate. Lets say the method looks like this psuedocode

Sub OnEvent()
 Delegate.Invoke
 Statement a
 Statement b

When the Invoke method is called does program control pass to the invoke method or does the invoke method go off and run in a separate thread. I think I remember reading that program control passes to the invoke method and then control returns to the OnEvent method after the invoke method has finished. Is this correct? I also think I remember reading that if multiple event handler methods are stored in the delegate you can't guarantee anything about the order in which they are executed.

thanks
amdrea
0
Comment
Question by:andieje
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
newbieal earned 1500 total points
ID: 24164283
0
 

Author Comment

by:andieje
ID: 24171253
Hi
thanks for posting but those links don't provide answers to the questions i asked
0
 
LVL 4

Expert Comment

by:newbieal
ID: 24177192
If you read through the information in the link it will answer your question, such as the fact that you are correct about your assumption regarding delegate function execution and the order of it in the context of the function.  It also talks about storing several in a delegate group, etc.

Please read through the info and then let me know if you still have questions and what exactly you need clarification on.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question