千年问心 2015-07-25 08:48 采纳率: 33.3%
浏览 2066

c# 读取或写入受保护的内存 异常

做的一个地图程序,程序集是其他公司提供的,当往地图里面有大概10000左右的点的时候 ,就会出现如下的错误 图片说明
异常信息如下
未处理 System.AccessViolationException
Message=尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
Source=Microsoft.DirectX.Direct3D
StackTrace:
在 Microsoft.DirectX.Direct3D.Device.DrawIndexedUserPrimitives(PrimitiveType primitiveType, Int32 minVertexIndex, Int32 numVertexIndices, Int32 primitiveCount, Object indexData, Boolean sixteenBitIndices, Object vertexStreamZeroData)
在 TKsoft.Earth.LineStringRender.Render(DrawArgs e) 位置 E:\Object\地图demo\Earth2.5\Renderable\NewLayer\LineStringRender.cs:行号 242
在 TKsoft.Earth.RenderableList`1.Render(DrawArgs drawArgs) 位置 E:\Object\地图demo\Earth2.5\Renderable\RenderableListT.cs:行号 107
在 TKsoft.Earth.WorldWindows.Render() 位置 E:\Object\地图demo\Earth2.5\WorldWindows\WorldWindows.cs:行号 464
在 TKsoft.Earth.WorldWindows.Application_Idle(Object sender, EventArgs e) 位置 E:\Object\地图demo\Earth2.5\WorldWindows\WorldWindows.cs:行号 846
在 System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr 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(Form mainForm)
在 AreaRadioMonitoringTest.Program.Main() 位置 E:\Object\海域无线\1DevelopLibrary\2SourceCode\AreaRadioMonitoringTest\Program.cs:行号 18
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
请问各位大神,出现这个异常主要有什么原因!!

  • 写回答

2条回答 默认 最新

  • devmiao 2015-07-25 08:52
    关注

    不正确地调用api,错误发生在mainform的构造函数中,不在这里。

    评论

报告相同问题?

悬赏问题

  • ¥15 一道python难题2
  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备