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

Events (backgroundworker)

Hello,

I would like to know how can I fire events of background worker when I
want to let know the main thread that the action finished and to send
results.
Is there a way to fire RunWorkerCompletedEventArgs in events from
background to main thread?
Thank you

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #1
2 1831
On Apr 16, 8:34*am, csharpula csharp <csharp...@yahoo.comwrote:
Hello,

I would like to know how can I fire events of background worker when I
want to let know the main thread that the action finished and to send
results.
Is there a way to fire RunWorkerCompletedEventArgs in events from
background to main thread?
Thank you

*** Sent via Developersdexhttp://www.developersdex.com***
If you are using a win app is easy, just keep a Control reference in
the worker thread and raise an event by calling Control.Invoke
Jun 27 '08 #2
The simples way to use use BackgroundWorker Class, you code DoWork event to
implement the time-consuming process and store the result in e.Result object,
and then code RunWorkerCompleted to get the operation result in e.Result.
See BackgroundWorker Class help:
http://msdn2.microsoft.com/en-us/lib...undworker.aspx
Hope this help!

"csharpula csharp" wrote:
Hello,

I would like to know how can I fire events of background worker when I
want to let know the main thread that the action finished and to send
results.
Is there a way to fire RunWorkerCompletedEventArgs in events from
background to main thread?
Thank you

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #3

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

Similar topics

9
by: GM | last post by:
Hi, My application has a need to cache a number of shared reference lists containing basic business objects. In order to improve performance these lists are fetched and updated in the...
15
by: Bryce K. Nielsen | last post by:
I have an object that starts a thread to do a "process". One of the steps inside this thread launches 12 other threads via a Delegate.BeginInvoke to process. After these 12 threads are launched,...
5
by: Rob R. Ainscough | last post by:
I'm using a BackgroundWorker to perform a file download from an ftp site. Per good code design practices where I separate my UI code from my core logic code (in this case my Download file method in...
3
by: Hardy Wang | last post by:
Hi all, I am migrating a Windows Form application from .Net 1.1 to 2.0. I try to use BackgroundWorker object to handle a very lengthy process. I have a separated class to handle some very complex...
9
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form...
5
by: raylopez99 | last post by:
I understand delegates (static and non-static) and I agree they are very useful, and that the "Forms" used in the Windows .NET API could not work without them. That said, I'm curious as to how...
1
by: slikrik98 | last post by:
Greetings, I believe I have narrowed down my issues to one simple question, and I'm hoping someone with async events experience can help me out. My question is: how is using...
16
by: AAaron123 | last post by:
I have a timer. At each tick, say 0.1 second, I write a file. If it takes more than 0.1 second to write the file the app will not work correctly. How can I tell in the tick event if the...
2
by: Martin Groh | last post by:
Hey, I'm trying to find a way to raise events from a thread or a delegate in such a way that it will not require the use of invoke when you are updating the gui. In other words, make the event...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.