473,320 Members | 1,991 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.

Synchronous Events?

I don't know how to do this persay, but maybe someone could give me a little
guidance.

I will start with an example, if you've ever heard of ComponentOne they have
a tool called DataObjects, this thing raises events many times, however, you
can modify data in the event args which is then passed back to the caller (I
don't really understand how because the events are declared ByVal).

Thats beside the point, but it appears to be synchronous (i.e. it waits for
a result to come back from the event handler.)

Anyone know how I can do this?

Thanks,
CJ
Nov 20 '05 #1
3 1153
In article <10*************@corp.supernews.com>, CJ Taylor wrote:
I don't know how to do this persay, but maybe someone could give me a little
guidance.

I will start with an example, if you've ever heard of ComponentOne they have
a tool called DataObjects, this thing raises events many times, however, you
can modify data in the event args which is then passed back to the caller (I
don't really understand how because the events are declared ByVal).

Because an Event arg is a reference type. Passing ByVal in this case
says to pass the referenc by value. That means you can still modify the
object..
Thats beside the point, but it appears to be synchronous (i.e. it waits for
a result to come back from the event handler.)

Anyone know how I can do this?


Events are syncronous by default. You have to work at it to do it async
:) So, your already where you want to be...

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 1 Build 2600
System Up Time: 6 Days, 1 Hours, 5 Minutes, 30 Seconds
Nov 20 '05 #2
Tom,


I will start with an example, if you've ever heard of ComponentOne they have a tool called DataObjects, this thing raises events many times, however, you can modify data in the event args which is then passed back to the caller (I don't really understand how because the events are declared ByVal).


Because an Event arg is a reference type. Passing ByVal in this case
says to pass the referenc by value. That means you can still modify the
object..


So I raise the event, everything that is hooked into it gets a message that
its been fired and my code that handles it fires. Your saying, no matter
what I can go ahead and modify my event args (given they are not read only)
and when it gets back from the Raise in the calling class, the modified
values will be there? (Basically, they are getting a copy of the values
that are located in the reference variable?)

Do I understand you correct?

So... further going on that, I should actually have to do nothing in order
for the two to work together as I expect, correct?

Thanks,
CJ
Thats beside the point, but it appears to be synchronous (i.e. it waits for a result to come back from the event handler.)

Anyone know how I can do this?


Events are syncronous by default. You have to work at it to do it async
:) So, your already where you want to be...

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 1 Build 2600
System Up Time: 6 Days, 1 Hours, 5 Minutes, 30 Seconds

Nov 20 '05 #3
In article <10*************@corp.supernews.com>, CJ Taylor wrote:
Tom,

>
> I will start with an example, if you've ever heard of ComponentOne they have > a tool called DataObjects, this thing raises events many times, however, you > can modify data in the event args which is then passed back to the caller (I > don't really understand how because the events are declared ByVal).
>
Because an Event arg is a reference type. Passing ByVal in this case
says to pass the referenc by value. That means you can still modify the
object..


So I raise the event, everything that is hooked into it gets a message that
its been fired and my code that handles it fires. Your saying, no matter
what I can go ahead and modify my event args (given they are not read only)
and when it gets back from the Raise in the calling class, the modified
values will be there? (Basically, they are getting a copy of the values
that are located in the reference variable?)

Do I understand you correct?


Pretty much.
So... further going on that, I should actually have to do nothing in order
for the two to work together as I expect, correct?


In most cases, yes. Now, if you pass a value type in you event
arguments then all bets are off, because a copy will get made. If you
use a reference type with properties, then yes - you don't have to do
anything special.

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 1 Build 2600
System Up Time: 6 Days, 18 Hours, 35 Minutes, 30 Seconds
Nov 20 '05 #4

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

Similar topics

1
by: Chris | last post by:
Hi. I have a ibrary I'm trying to use via javascript within IE. This library uses an asynchronous model where I call into a function and pass it a callback function as one of its arguments. My...
9
by: David | last post by:
Hello I'm testing the XMLHttpRequest object in Firefox and IE. The code below works well in IE and Firefox. It shows "1" when the string is a number and "0" when not. The page aspxTest.aspx only...
5
by: Jeff Weber | last post by:
First, my question: Should I use Write or BeginWrite (sync or async) to stream data to my clients over a TCPClient connection. Details: On the server I have a custom circular data buffer that...
3
by: Al | last post by:
Hi, I believe that when an event is Raised is C#, it is performed synchronously, as a value is returned by the event handler, even if that value is NULL. However, as VB does not have the ability...
1
by: Shri Shrikumar | last post by:
Hi All, I am not sure if this is the right list for this question, so if its not, I would appreciate a pointer in the right direction. Anyways, I would like to know if triggers are synchronous...
1
by: AECL_DEV | last post by:
Hello Everyone, Ive seen alot of people saying that the best way to AJAX Validate a form is through the submit button, because validation should be synchronous. Im wondering, is there any good...
5
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
1
by: BahatiSiD | last post by:
Hello! I have a class instance that fires events and they are handled in a form. I believe this kind of event is called trivial: public: delegate void CpuStepEventHandler(Object^ sender,...
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
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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
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.