hDC 的内存管理

发布于 2024-10-10 12:40:41 字数 131 浏览 0 评论 0原文

我有一个 ID3DXFont(顺便说一下,它是 Direct3D9),它提供了一个 GetDC() 方法,该方法返回设备上下文 (hDC) 的句柄。如何管理该值的内存? MSDN 没有提及任何相关内容,也没有像 COM 接口那样提供自己的内存管理。

I've got an ID3DXFont (which is Direct3D9, by the way) which offers a method GetDC() which returns a handle to a device context (hDC). How is the memory for this value managed? MSDN doesn't mention anything about it and it doesn't provide it's own memory management like COM interfaces do.

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

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

发布评论

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

评论(3

如此安好 2024-10-17 12:40:41

您需要使用 ReleaseDC(HDC) 释放该句柄。

You need to release that handle with ReleaseDC(HDC).

纵山崖 2024-10-17 12:40:41

不能在句柄上使用 SAFE_RELEASE 宏吗?

Can't you use SAFE_RELEASE macro on the handle?

可遇━不可求 2024-10-17 12:40:41

我相信当您完成后,您必须在返回的句柄上调用 DeleteDC 。很难找到对此的太多参考,除了 this gamedev.net 上的线程。

I believe you have to call DeleteDC on the handle returned, when you are done with it. It was difficult to find much reference to this, with the exception of a comment made in this thread on gamedev.net.

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