473,408 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Cross Threading

hi EveryOne,

I am working on vs 2005 on VB.net
the fallowing exception came while running this exception cames with stacktrace.
If any one know the solution if share it me then it will be help full for me.

Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on. at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.set_Location(Point value)
at Janus.Windows.GridEX.ScrollableBase.a(Rectangle )
at Janus.Windows.GridEX.ScrollableBase.d()
at Janus.Windows.GridEX.ScrollableBase.a(Boolean )
at Janus.Windows.GridEX.GridEX.d(Graphics )
at Janus.Windows.GridEX.GridEX.a(Graphics )
at Janus.Windows.GridEX.GridEX.r()
at Janus.Windows.GridEX.GridEX.a(Int32 , GridEXColumn )
at Janus.Windows.GridEX.GridEX.EnsureVisible(Int32 rowPosition, GridEXColumn column)
at Janus.Windows.GridEX.GridEX.EnsureVisible()
at Janus.Windows.GridEX.GridEX.a(Int32 , GridEXColumn , Boolean )
at Janus.Windows.GridEX.GridEX.c(Int32 , GridEXColumn )
at Janus.Windows.GridEX.GridEX.t(Int32 )
at Janus.Windows.GridEX.GridEX.set_Row(Int32 value)
at Janus.Windows.GridEX.GridEX.m()
at Janus.Windows.GridEX.GridEX.Refetch()
at Janus.Windows.GridEX.GridEX.af()
at Janus.Windows.GridEX.GridEX.a(Boolean )
at Janus.Windows.GridEX.GridEX.RetrieveStructure(Bool ean retrieveChildTables)
at Janus.Windows.GridEX.GridEX.RetrieveStructure()
at TradeCompanion.StrategyPerformanceReport.ShowSpotP osition() in D:\Scalper\TradeCompanion\TradeCompanion_BGC\Strat egyPerformanceReport.vb:line 312
Jun 11 '07 #1
2 2417
RedSon
5,000 Expert 4TB
Looks like you are using a non standard namespace. Janus is not listed. I will have to refer you to the documentation.

hi EveryOne,

I am working on vs 2005 on VB.net
the fallowing exception came while running this exception cames with stacktrace.
If any one know the solution if share it me then it will be help full for me.

Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on. at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.set_Location(Point value)
at Janus.Windows.GridEX.ScrollableBase.a(Rectangle )
at Janus.Windows.GridEX.ScrollableBase.d()
at Janus.Windows.GridEX.ScrollableBase.a(Boolean )
at Janus.Windows.GridEX.GridEX.d(Graphics )
at Janus.Windows.GridEX.GridEX.a(Graphics )
at Janus.Windows.GridEX.GridEX.r()
at Janus.Windows.GridEX.GridEX.a(Int32 , GridEXColumn )
at Janus.Windows.GridEX.GridEX.EnsureVisible(Int32 rowPosition, GridEXColumn column)
at Janus.Windows.GridEX.GridEX.EnsureVisible()
at Janus.Windows.GridEX.GridEX.a(Int32 , GridEXColumn , Boolean )
at Janus.Windows.GridEX.GridEX.c(Int32 , GridEXColumn )
at Janus.Windows.GridEX.GridEX.t(Int32 )
at Janus.Windows.GridEX.GridEX.set_Row(Int32 value)
at Janus.Windows.GridEX.GridEX.m()
at Janus.Windows.GridEX.GridEX.Refetch()
at Janus.Windows.GridEX.GridEX.af()
at Janus.Windows.GridEX.GridEX.a(Boolean )
at Janus.Windows.GridEX.GridEX.RetrieveStructure(Bool ean retrieveChildTables)
at Janus.Windows.GridEX.GridEX.RetrieveStructure()
at TradeCompanion.StrategyPerformanceReport.ShowSpotP osition() in D:\Scalper\TradeCompanion\TradeCompanion_BGC\Strat egyPerformanceReport.vb:line 312
Jun 11 '07 #2
TRScheel
638 Expert 512MB
It would be helpful if you showed some of the code surrounding line 312 on

StrategyPerformanceReport.vb

Although, if you are hesistant to do so, know that this error comes from multithreaded applications accessing each other in an... unsafe manner. You can code for this, and just catch the exception OR you can do it in a better form.

Delegates and Events might be up your alley, depending on your coding situation.

MSDN2 Information on Delegates

Using a delegate, you can push the call of whatever function is causing your issue from the THREAD it originated from, not the thread calling it. This should fix it, although I would need more information to tell you definitively.
Jun 11 '07 #3

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

Similar topics

7
by: Terry Olsen | last post by:
I run this code: Private Sub p_recv(ByVal sender As Object, ByVal e As SerialReceivedEventArgs) Handles p.ReceivedEvent txtRecv.Text += p.ReadExisting End Sub I get this error: ...
2
by: genojoe | last post by:
In simplified form, I have an RTF control and a timer. I use the timer to do an autoresave for the RFT control every 5 minutes. Here is the abridged code. Private Sub tmrAutoRecover_Tick(ByVal...
2
by: m.lancashire | last post by:
I have a dotnet 2.0 web service method that I execut asynchronously using the auto generated method. I catch the event using this Private Sub Event_Completed(ByVal sender As Object _ , ByVal e As...
3
by: jlamanna | last post by:
I was wondering if there was a utility that could tell you when your C# application is making cross-apartment COM calls. I have a fairly large application that makes extensive use of a 3rd party...
11
by: HairlipDog58 | last post by:
Hello, There are several 'cross-thread operation not valid' exception postings in the MSDN discussion groups, but none address my exact situation. I have authored a .NET component in Visual C#...
3
by: Pieter Coucke | last post by:
Hi, In my VB.NET 2005 application I'm generating and sending emails using the outlook-object model (2003). When a mail is Send (MailObject_Send), I raise an event in a global class, that is...
5
by: Rob R. Ainscough | last post by:
I'm using a BackgroundWorker to perform a file download from an ftp site. Per good code design practices where I separate my UI code from my core logic code (in this case my Download file method in...
6
by: Joe | last post by:
I've been getting this message at all different times since a few days ago. I understand the message but not why I get it. I don't have any other threads. This happens when closing dialog boxes,...
42
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
I'm currently writing a program and I've got in mind to keep it as portable as possible. In particular I want it to run on Linux and Windows, but I'm also keeping an open mind to any machine that...
2
by: bhupendrakumar | last post by:
error message System.InvalidOperationException was unhandled Message="Cross-thread operation not valid: Control 'listView2' accessed from a thread other than the thread it was created on." ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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...

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.