急!vs2010简单的winapp,拖一个groupbox,报内存只读错误

cnyyk 2014-05-09 05:06:15
打开vs2010,新建一个简单的winapp,拖一个groupbox,运行,报内存只读错误。

问题现象:
1、vs2010,默认c#开发环境。
2、建一个windows form application的项目,编译,运行,正常。
3、拖一个button上去,运行,正常。
4、拖一个groupbox上去,运行,报错。先是显示了form1,紧接着,program.cs最后一句,Application.Run(new Form1());,报错,提示内存为只读,可能损坏之类的。百思不得其解。翻遍各大网站,无解。stackoverflow,无解。
5、重装系统,重新装vs2010,运行这个程序,依然如此错误。。。
6、vs2010是全新安装的,没动过其他设置。

求各位相助为谢。
...全文
137 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnyyk 2014-05-10
  • 打赏
  • 举报
回复
Found the solution that worked for me. Either upgrade or rollback your video drivers. I have a Radeon HD6950 with driver version 9.00.100.10. When I rolled back the driver to version 8.980.0.0. the "gdipdrawline" errors stopped. This means all the controls that used the function now also work. I can confirm working the GroupBox and the DataGridView as they previously crashed with the same or similar call stacks. http://stackoverflow.com/questions/18245212/graphics-drawline-accessviolation-visual-studio-ide 貌似我刚更新了显卡驱动。可能是这个问题。。。干。
cnyyk 2014-05-10
  • 打赏
  • 举报
回复
System.AccessViolationException was unhandled Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Source=System.Drawing StackTrace: at System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at System.Windows.Forms.GroupBox.DrawGroupBox(PaintEventArgs e) at System.Windows.Forms.GroupBox.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.GroupBox.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.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 WindowsFormsApplication2.Program.Main() in e:\home\documents\visual studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\Program.cs:line 18 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
cnyyk 2014-05-10
  • 打赏
  • 举报
回复
麻烦各位指点一二。

110,532

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧