System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
12 באוקטובר 2007
This is the most annoying bug I had to handle. Here's the exception details: Message: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." Source: "System.Windows.Forms" Stack Trace: at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object args, Boolean synchronous)at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object args)at System.Windows.Forms.ButtonBase.OnFrameChanged(Object o, EventArgs e)at System.Drawing.ImageAnimator.ImageInfo.OnFrameChanged(EventArgs e)at System.Drawing.ImageAnimator.ImageInfo.set_Frame(Int32 value)at System.Drawing.ImageAnimator.AnimateImages50ms()at System.Threading.ThreadHelper.ThreadStart_Context(Object state)at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.ThreadHelper.ThreadStart() The thing is, that the programmer who wrote the code that caused the problem knew nothing about multithreading, nor did he know how to read and understand the exception details, and the...