Reasons Why RegisterClass() and CreateWindow() FailLast reviewed: November 2, 1995Article ID: Q65257 |
The information in this article applies to:
SUMMARYThe RegisterClass() and CreateWindow() functions fail when the system resources are used up. The percentage of free system resources reflects the amount of available space in the USER and GDI heaps within Windows. The smaller amount of free space is reported in the Program Manager's About box because if either heap fills up, functions fail. Under Windows NT, the USER and GDI heap resources are practically unlimited. Under Windows 95, the USER and GDI heap resources are greater than Windows 3.1, but not as great as under Windows NT.
MORE INFORMATIONIf the amount of free system resources remains low after the application is exited, it is more likely that the GDI heap is filling. The main reason for the GDI heap filling is that GDI objects that are created by the application are not deleted or destroyed when they are no longer needed, or when the program terminates. Windows does not delete GDI objects (pens, brushes, fonts, regions, and bitmaps) when the program exits. Objects must be properly deleted or destroyed. NOTE: Win32-based applications cannot cause the USER or GDI heaps to overflow when they terminate, because the system will release the resources to maximize available resources. The following are two situations that can cause the USER heap to get full:
|
Additional reference words: 3.00 3.10 3.50 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |