PRB: GDI Heap Fills Up While Playing a Metafile
Article ID: 119453
Article Last Modified on 2/14/2005
APPLIES TO
- Microsoft Windows Software Development Kit 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.
Additional query words: 3.10
Keywords: kb16bitonly kbprb KB119453