SUMMARY
You can note via Program Manager's "About Box" that Windows's System
Resources can be inadvertently reduced by a Windows-based application,
causing subsequent
RegisterWindow() or
CreateWindow() function calls to fail.
The system resources are a reflection of the lower USER and GDI's data
segments. The following steps eliminate the major causes of USER's
data segment fill-up listed in the following:
- Ensure that the cbClsExtraBytes and cbWndExtraBytes are set to 0 in the WNDCLASS structure, unless the application is definitely using them.
- Ensure that a MakeProcInstance() is performed and the window
procedure is EXPORTed in the .DEF file.
- Use CVW to verify that the application is receiving the WM_CREATE message.
- Confirm that all menus created, loaded, or added dynamically [that is,
using CreateMenu(), AppendMenu(), and so forth] are properly destroyed before terminating the application.
The main reason why GDI's data segment fills up is that objects are being
created and are not being destroyed when they are no longer needed.