这个问题有很多变体,但我找不到我需要的答案。我唯一需要显示的是堆栈跟踪(类似于为这个问题发布的其他堆栈跟踪) 从跟踪中,我无法确定代码中发生这种情况的位置。当时,代码应该已经更新并添加到几个 listView 控件并进行一些文件写入。这个问题的答案涵盖了资源、文件锁、权限、字体、多线程和其他各种东西,但我没有足够的信息来开始。如果有人能对这个堆栈告诉我的内容有所了解,并提供一个可靠的想法/答案,甚至是如何诊断或解决问题的策略,我将不胜感激(我相信我的格式正确,但很抱歉如果我没有
System.Runtime.InteropServices.ExternalException was unhandled
_HResult=-2147467259
_message=A generic error occurred in GDI+.
HResult=-2147467259
IsTransient=false
Message=A generic error occurred in GDI+.
Source=System.Drawing
ErrorCode=-2147467259
StackTrace:
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
at System.Drawing.Graphics.MeasureString(String text, Font font, Int32 width)
at System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)
at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Timer.TimerNativeWindow.OnThreadException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Alpha_Strategy_Engine.Program.Main() in c:\Users\Jeffery\Documents\Visual Studio 2013\Projects\Alpha Strategy Engine\Program.cs:line 50
InnerException: