0

我围绕 Unity 构建了一个简单的应用程序框架。即表单和用户控件被描述为 xml 并动态构建。我有一个包含 ComboBox 的表单,当它关闭时会导致下面详述的错误。如果 ComboBox 替换为 ListBox 控件,则不会发生此问题。

一些谷歌搜索引发了一些关于我无法安装的补丁的报告.. KB923028

{“试图读取或写入受保护的内存。这通常表明其他内存已损坏。”}

堆栈跟踪:

   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WmCommand(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ComboBox.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(Int32 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 DPOSSQL.Program.Main() in C:\VSSData\DPOS SQL\DPOS SQL\Program.cs:line 46
   at System.AppDomain._nExecuteAssembly(Assembly 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)
   at System.Threading.ThreadHelper.ThreadStart()
4

3 回答 3

0

当我的 .NET 应用程序正在运行时,尝试将系统显示切换到“超大字体”时,只需在 Windows XP 上点击它即可。

似乎这与格式错误的字体或类似字体有关。

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source: System.Windows.Forms
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 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)
于 2010-01-20T02:25:03.663 回答
0

当控件使用 XP/Vista 样式然后在旧版本的 Windows 上运行时,我已经看到了这种情况。

于 2009-05-19T19:14:24.017 回答
0

我在系统上安装新字体时看到了这个错误。您是否安装了新字体,或者最近安装了新字体的程序?

其他 .net 程序是否正常运行?如果没有,最好的办法可能是重新安装 .NET 框架。

于 2009-05-19T19:32:35.527 回答