06-25-2009 03:10 AM
有時程式在跑時會出現以下錯誤,請問會是什麼原因呢
ystem.InvalidOperationException 未處理
Message="集合已修改; 列舉作業可能尚未執行。"
Source="mscorlib"
StackTrace:
於 System.Collections.Hashtable.HashtableEnumerator.MoveNext()
於 NationalInstruments.UI.Internal.InnerAxisElement.a(ComponentDrawArgsInternal A_0, RectangleF[] A_1)
於 NationalInstruments.UI.Internal.InnerAxisElement.DrawForeground(ComponentDrawArgsInternal args)
於 NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
於 NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
於 NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
於 NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
於 NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
於 NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1)
於 NationalInstruments.Restricted.ControlElement.Paint(PaintEventArgs e)
於 NationalInstruments.UI.WindowsForms.ControlBase.OnPaint(PaintEventArgs e)
於 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
於 System.Windows.Forms.Control.WmPaint(Message& m)
於 System.Windows.Forms.Control.WndProc(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
於 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
於 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
於 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
於 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
於 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
於 System.Windows.Forms.Application.Run(ApplicationContext context)
於 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
於 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
於 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
於 WindowsApplication1.My.MyApplication.Main(String[] Args) 於 17d14f5c-a337-4978-8281-53493378c1071.vb: 行 81
於 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
於 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
於 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
於 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
於 System.Threading.ThreadHelper.ThreadStart()
InnerException:
06-29-2009 01:16 AM
May I know your version of VB.NET?
version of Measurement Studio?
OS ?
06-29-2009 03:49 AM
os:windows xp sp3
Microsoft Visual Studio 2008
Measurement Studio 8.6
06-30-2009 09:51 PM
12-14-2009 08:36 AM
The same exception was thrown in my application when I've worked with ScatterGraph.
One can chose ScopeChart mode instead StripChart for problematic axis (usually x axis). Using this mode, the problem is avoided. Or, if you create your graphs dynamically, you can recreate graph that was thrown an exception (actually, I recreate all graphs that are presented if exception is thrown). User can see a little flicker, and application continues to work.
04-22-2010 09:18 PM
04-23-2010 12:09 AM
我已試到答案但不知是否正確,目前run都沒問題 ScatterGraph1.Plots.Item(0).XAxis.Mode = AxisMode.AutoScaleLoose 將mode改變一下就行了 |
04-25-2010 10:57 PM
跑久了還是一樣會出錯...不知道該如何解決了..