Worker thread questions

A

active

I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle


I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance
 
H

Harry Strybos

active said:
I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle


I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance
I have been having a lot of success with component classes. Essentially, a
component class allows all you describe. It also reports progress and allows
for aborting the process.

It is outside the scope of this forum to give you a detailed insight into
component classes. However, this may give you a good place to start.
Component classes are also excellent for code re-use.

Cheers
 
T

Tom Shelton

I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle

I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance

I would just look at the BackgroundWorker component if you are using
VB2005.
 
A

active

I'll try to check this out.
thanks

Harry Strybos said:
I have been having a lot of success with component classes. Essentially, a
component class allows all you describe. It also reports progress and
allows for aborting the process.

It is outside the scope of this forum to give you a detailed insight into
component classes. However, this may give you a good place to start.
Component classes are also excellent for code re-use.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top