PRB: GDI Heap Fills Up While Playing a Metafile (119453)



The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) 3.1

This article was previously published under Q119453
3.10 WINDOWS kbprg kbprb

SYMPTOMS

During the playback of a metafile or printing, the GDI heap fills up and it is not possible to create additional GDI objects.

CAUSE

This filling of the GDI heap can be caused by a metafile that does not contain any DELETEOBJECT metafile records. The GDI objects created during the metafile playback never get deleted, which fills up the GDI heap. An application that prints without using banding in Windows version 3.1 causes a metafile to be created on behalf of the application. The problem listed above then occurs.

The DELETEOBJECT metafile record is a new feature developed for Windows version 3.1. This record is used to record DeleteObject() calls into the metafile, so that the specified GDI object is deleted during playback of the metafile. If you call DeleteObject() on an object that is currently selected into a metafile Device Context (DC), a DELETEOBJECT record will not be recorded into the metafile. The documentation for DeleteObject() states that the object must not be selected into a DC.

RESOLUTION

Make sure to deselect the object in your metafile DC before calling DeleteObject() to delete the object.

For additional information about calling DeleteObject() for a metafile object, please see the following article(s) in the Microsoft Knowledge Base:

68296 Windows 3.x Metafiles Support DeleteObject()

STATUS

This behavior is by design.

Modification Type:MinorLast Reviewed:2/14/2005
Keywords:kb16bitonly kbprb KB119453