?
Solved

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

Posted on 2007-11-17
3
Medium Priority
?
193 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 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