内存不足异常未处理

发布于 2024-10-09 19:08:01 字数 159 浏览 0 评论 0原文

我正在开发项目,最小表单是其他表单(MDI 应用程序)的父级 运行时的所有子表单都在工作,但是当我单击打开销售表单的按钮时,项目崩溃并给我这个错误

创建窗口句柄时出错。 内存不足异常未处理

我正在使用 Visual Studio 2008 并使用 C# 3.5 进行开发

I am Developing project the min Form is Parent to the other Forms ( MDI Application )
the all Child Forms in the running time are working ,, but when i click on the button that open the sales Form ,, the Project is Break down and give me this Error

Error creating window handle.
Out of Memory Exception was unhandled

i am using Visual Studio 2008 and Develop using C# 3.5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我喜欢麦丽素 2024-10-16 19:08:01

你的窗把手漏水了。运行 TaskMgr.exe,“进程”选项卡。查看+选择列,勾选用户对象。请观看该专栏了解您的流程。当您使用该程序时,您会看到它不断上升,当数字达到 10000 时,它就会崩溃。

当您不在代码中删除的控件上调用 Dispose() 时,就会发生这种情况。使用 Controls.Clear 或 Controls.Remove。

You are leaking window handles. Run TaskMgr.exe, Processes tab. View + Select Columns, tick USER objects. Watch that column for your process. You'll see it climbing up while you use the program, it bombs when the number reaches 10000.

This happens when you don't call Dispose() on controls that you remove in your code. Either with Controls.Clear or Controls.Remove.

幸福丶如此 2024-10-16 19:08:01

在实例化或加载销售表单期间可能存在无限循环。要找到问题,请备份表单,然后开始从中删除内容,直到不再抛出 OutOfMemoryException 为止。

There may be an infinite loop during instantiation or loading of your sales form. To find the problem, make a backup of your form and then start removing stuff from it until it doesn't throw OutOfMemoryException anymore.

°如果伤别离去 2024-10-16 19:08:01

创建窗口句柄时使用 try catch,捕获异常并相应地处理它,但此时抛出内存不足可能是异常的?

Use a try catch when creating the window handle, and catch the exception and handle it accordingly, it might be anomalous that it's throwing an Out Of Memory at that point though?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文