Solved

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

Posted on 2007-11-17
3
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20304632
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
ID: 20304655
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
ID: 20304722
Thank you so much... that did it! (CheckForIllegalCfrossThreadCalls)...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
asp.net web app does not update text field to show progress during long process 8 29
Pdf not loading 2 39
C# Change the instruction to user. 11 39
How does this modal work? 3 33
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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 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