Click here to Skip to main content
15,890,845 members
Home / Discussions / C#
   

C#

 
AnswerRe: Illegal cross thread exception in Invoke method Pin
Abhinav S17-Mar-10 4:51
Abhinav S17-Mar-10 4:51 
GeneralRe: Illegal cross thread exception in Invoke method Pin
AspDotNetDev17-Mar-10 12:30
protectorAspDotNetDev17-Mar-10 12:30 
GeneralRe: Illegal cross thread exception in Invoke method Pin
Luc Pattyn17-Mar-10 12:52
sitebuilderLuc Pattyn17-Mar-10 12:52 
AnswerRe: Illegal cross thread exception in Invoke method Pin
Dave Kreskowiak17-Mar-10 4:59
mveDave Kreskowiak17-Mar-10 4:59 
GeneralRe: Illegal cross thread exception in Invoke method [modified] Pin
yeah100017-Mar-10 5:07
yeah100017-Mar-10 5:07 
GeneralRe: Illegal cross thread exception in Invoke method Pin
Luc Pattyn17-Mar-10 5:14
sitebuilderLuc Pattyn17-Mar-10 5:14 
GeneralRe: Illegal cross thread exception in Invoke method Pin
AspDotNetDev17-Mar-10 12:24
protectorAspDotNetDev17-Mar-10 12:24 
GeneralRe: Illegal cross thread exception in Invoke method Pin
yeah100018-Mar-10 1:33
yeah100018-Mar-10 1:33 
Here is the stack trace, perhaps it can help clarify the problem...
C#
System.InvalidOperationException was unhandled
  Message="Cross-thread operation not valid: Control 'SomeClass' accessed from a thread other than the thread it was created on."
  Source="System.Windows.Forms"
  StackTrace:
       at System.Windows.Forms.Control.get_Handle()
       at System.Windows.Forms.Control.get_InternalHandle()
       at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
       at System.Windows.Forms.RichTextBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
       at System.Windows.Forms.Control.DefWndProc(Message& m)
       at System.Windows.Forms.Control.WmCreate(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
       at System.Windows.Forms.RichTextBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
       at System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
       at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
       at System.Windows.Forms.Control.CreateHandle()
       at System.Windows.Forms.TextBoxBase.CreateHandle()
       at System.Windows.Forms.Control.get_Handle()
       at System.Windows.Forms.RichTextBox.get_TextLength()
       at SomeNamespace.SomeClass.Changetext(String text, Color color) in C:\...\SomeClass.cs:line 827
       at SomeNamespace.SomeClass.SomeThreadFun() in C:\...\SomeClass.cs:line 112
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

GeneralRe: Illegal cross thread exception in Invoke method Pin
yeah100031-Mar-10 6:16
yeah100031-Mar-10 6:16 
GeneralRe: Illegal cross thread exception in Invoke method Pin
AspDotNetDev31-Mar-10 9:27
protectorAspDotNetDev31-Mar-10 9:27 
GeneralRe: Illegal cross thread exception in Invoke method Pin
yeah100031-Mar-10 21:56
yeah100031-Mar-10 21:56 
GeneralRe: Illegal cross thread exception in Invoke method Pin
AspDotNetDev2-Apr-10 21:26
protectorAspDotNetDev2-Apr-10 21:26 
GeneralRe: Illegal cross thread exception in Invoke method Pin
yeah10005-Apr-10 1:39
yeah10005-Apr-10 1:39 
GeneralRe: Illegal cross thread exception in Invoke method Pin
AspDotNetDev5-Apr-10 20:27
protectorAspDotNetDev5-Apr-10 20:27 
GeneralRe: Illegal cross thread exception in Invoke method Pin
yeah10007-Apr-10 5:59
yeah10007-Apr-10 5:59 
GeneralRe: Illegal cross thread exception in Invoke method Pin
AspDotNetDev7-Apr-10 9:10
protectorAspDotNetDev7-Apr-10 9:10 
GeneralRe: Illegal cross thread exception in Invoke method Pin
yeah10007-Apr-10 10:01
yeah10007-Apr-10 10:01 
QuestionSub Containers Control Pin
Xmen Real 17-Mar-10 4:05
professional Xmen Real 17-Mar-10 4:05 
AnswerRe: Sub Containers Control Pin
Bernhard Hiller17-Mar-10 4:40
Bernhard Hiller17-Mar-10 4:40 
GeneralRe: Sub Containers Control Pin
Xmen Real 17-Mar-10 5:16
professional Xmen Real 17-Mar-10 5:16 
GeneralRe: Sub Containers Control Pin
Keith Barrow17-Mar-10 5:33
professionalKeith Barrow17-Mar-10 5:33 
GeneralRe: Sub Containers Control Pin
Xmen Real 17-Mar-10 7:00
professional Xmen Real 17-Mar-10 7:00 
Questionbind from XML Pin
Jassim Rahma17-Mar-10 3:52
Jassim Rahma17-Mar-10 3:52 
AnswerRe: bind from XML Pin
Kythen17-Mar-10 5:33
Kythen17-Mar-10 5:33 
QuestionFilesInfo to DataGrid Pin
Jassim Rahma17-Mar-10 3:36
Jassim Rahma17-Mar-10 3:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.