的WinForms问题 - 错误创建窗口句柄 [英] Winforms issue - Error creating window handle

查看:1293
本文介绍了的WinForms问题 - 错误创建窗口句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在一个WinForm应用程序看到此错误。谁能帮助你为什么会看到这个错误,更重要的是如何解决它或发生避免它。


System.ComponentModel.Win32Exception:错误创建窗口句柄。
   在System.Windows.Forms.NativeWindow.CreateHandle(CP的CreateParams)
   在System.Windows.Forms.Control.CreateHandle()
   在System.Windows.Forms.Control.CreateControl(布尔fIgnoreVisible)
   在System.Windows.Forms.Control.CreateControl()
   在System.Windows.Forms.Control.OnVisibleChanged(EventArgs的发送)
   在System.Windows.Forms.ButtonBase.OnVisibleChanged(EventArgs的发送)


解决方案

你有没有运行Process Explorer或Windows任务管理器看看GDI对象,句柄,线程和用户对象?如果没有,选择要查看的列(任务管理器中选择查看 - >选择列...然后运行你的应用程序,并看一看该应用这些列,看看其中的一个正在成长真正的大。

这可能是你有你的认为的被清理,但尚未处理完毕的UI组件。

这里有一个关于这个链接可能会有所帮助。

祝您好运!

We are seeing this error in a Winform application. Can anyone help on why you would see this error, and more importantly how to fix it or avoid it from happening.

System.ComponentModel.Win32Exception: Error creating window handle.
   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.ButtonBase.OnVisibleChanged(EventArgs e)

解决方案

Have you run Process Explorer or the Windows Task Manager to look at the GDI Objects, Handles, Threads and USER objects? If not, select those columns to be viewed (Task Manager choose View->Select Columns... Then run your app and take a look at those columns for that app and see if one of those is growing really large.

It might be that you've got UI components that you think are cleaned up but haven't been Disposed.

Here's a link about this that might be helpful.

Good Luck!

这篇关于的WinForms问题 - 错误创建窗口句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆