德尔福EOutOfResources(GDIError) [英] Delphi EOutOfResources (GDIError)

查看:117
本文介绍了德尔福EOutOfResources(GDIError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个应用程序,在其中我偶尔发现EOutofResources错误 将TBitmap32保存到流时,由Graphics单元的GDIError方法引发.

I have written an application in which I find ocasionally EOutofResources errors raised by GDIError method of Graphics unit when saving TBitmap32 to a stream.

据我所知,它可能来自gdi限制或堆限制. 我知道该过程的默认限制为10000个句柄. 因此,根据任务管理器的应用程序仅报告620.

As far as I know it can come from gdi limits or heap limits. i know that for the process there is a default limit of 10000 handles. So my application according to the task manager reports only 620.

我已经下载并运行了Desktop Heap Information Monitor工具,该工具报告了以下内容:

I have downloaded and run Desktop Heap Information Monitor Tool which reported this:

Desktop Heap Information Monitor Tool (Version 8.1.2925.0)
Copyright (c) Microsoft Corporation.  All rights reserved.
-------------------------------------------------------------
  Session ID:    0 Total Desktop: (  7360 KB -   11 desktops)

  WinStation\Desktop            Heap Size(KB)    Used Rate(%)
-------------------------------------------------------------
  WinSta0\Default                    3072             44.5
  WinSta0\Disconnect                   64              4.5
  WinSta0\Winlogon                    128             10.2
  Service-0x0-3e7$\Default            512             29.1
  Service-0x0-3e4$\Default            512              6.8
  Service-0x0-3e5$\Default            512              6.8
  SAWinSta\SADesktop                  512              0.5
  __X78B95_89_IW\__A8D9S1_42_ID       512              0.5
  Service-0x0-1ae39$\Default          512              2.4
  Service-0x0-12d284a7$\Default       512              2.5
  Service-0x0-1312b6d4$\Default       512             15.0
-------------------------------------------------------------

如上所述,我仅在winsta0中使用了44%的桌面堆.

As above I have used only 44% of the desktop heap in winsta0.

此外还会不时出现此错误.它从来没有达到提到的极限. 我如何检查问题出在哪里?是什么原因导致出现此错误?

Besides this error is raised from time to time. it never reaches mentioned limits. How can i check where the problem is? What causes raising this error?

谢谢

推荐答案

这可能根本不是资源错误.有时,Delphi将报告无法转换为特定错误消息的GDI错误作为资源不足.请参阅Graphics.pas中的GDIError的实现.

This probably isn't a resource error at all. Sometimes Delphi will report GDI errors that can't be translated into a specific error message as out-of-resources. See the implementation of GDIError in Graphics.pas.

如果您可以在IDE中重现此错误,则找出错误发生原因的最佳方法可能是在编译器设置中启用使用调试DCU"选项,并在运行应用程序时启用停止Delphi异常调试"选项

If you can reproduce this in the IDE, the best way to find out where/why it happens is probably to enable the Use Debug DCUs option in the compiler settings and have the Stop On Delphi Exceptions debugger option enabled while running your app.

这篇关于德尔福EOutOfResources(GDIError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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