473,473 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C#-APP:Cross-thread operation not valid

2 New Member
Hello

I know that there was similar thread on this forum, however, I didn’t find answer for my problem there. I also think that my situation is slightly different.

I have problem with InvalidOperationException with message: Control '' accessed from a thread other than the thread it was created on

I have read MSDN documentation and I know the theory and solution (use Invoke). But, it seems to me that exception is generated in the place where it shouldn't.

I check the identifier of the thread in which the control was created and identifier of the thread in which the control was used and exception was thrown. These identifiers ware the same.

Secondly the problem doesn't appear on every machine.

Last but not the least when I start application by double-click one control cause exception. However, when I start application from VisualStudio another control cause the problem.

I spent some time debugging this problem and I didn't find solution. I'll be happy if someone help me :)
Feb 29 '08 #1
4 1650
kenobewan
4,871 Recognized Expert Specialist
This article may help:
Thread Safety Made Easier Under Visual Studio 2005
Feb 29 '08 #2
Plater
7,872 Recognized Expert Expert
The only time I ever see that Exception get thrown is in debug mode.
When not debugging it always goes away for me.

Regardless, due to the nature of the type of error, you will not be able to examine the values in the debugger to see that they are different, they will always show up the same.
Just go through the Invoke process and see if it rids you of the exception.
Feb 29 '08 #3
Cappamontana
21 New Member
I don't know your code but I had the same problem...I fixed it by using BackgroundWorkers.
Feb 29 '08 #4
misiek1984
2 New Member
Regardless, due to the nature of the type of error, you will not be able to examine the values in the debugger to see that they are different, they will always show up the same..
I have checked threads' identifiers not only in debug mode but also by logging threads' ids to the file. In this situation they were also the same.
Feb 29 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
4
by: David Peach | last post by:
Hello, hope somebody here can help me... I have a query that lists defects recorded in a user defined date range. That query is then used as the source for a Cross Tab query that cross-tabs count...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
7
by: Scott M. | last post by:
How can I disable the cross-site scripting check for one particular page of a site?
1
by: Rob Woodworth | last post by:
Hi, I'm having serious problems getting my report to work. I need to generate a timesheet report which will contain info for one employee between certain dates (one week's worth of dates). I...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
6
by: ampo | last post by:
Hello. Can anyone help with cross-domain problem? I have HTML page from server1 that send xmlHTTPRequest to server2. How can I do it? Thanks.
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.