Solved

How to make class a separate thread? (continued from #22957773)

Posted on 2007-11-17
3
151 Views
Last Modified: 2010-04-15
In reference to the question above, I have tried to do as suggested.  However, there are some properties that I need to reference outside of the thread.  I am getting the following message:

Cross-thread operation not valid: Control 'lPricingServiceStatus' accessed from a thread other than the thread it was created on.

How do I cure this?

I also noticed that I can not start a thread on a method that needs paramaters passed to it... is there a way around this?
0
Comment
Question by:rmmarsh
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
About the thread with parameters, collect all your parameters in a single object and use ParameterizedThreadStart to start thread. Have a look to the explanation at:
http://www.codeproject.com/cs/threads/parameterizedthreads.asp
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
Comment Utility
about the cross-thread check, you can waive it. Implement a Load event in your form, and write inside:

CheckForIllegalCrossThreadCalls = false;
0
 

Author Comment

by:rmmarsh
Comment Utility
Thank you so much... that did it! (CheckForIllegalCfrossThreadCalls)...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now