Knowledge Base

PRB: Windows Properties Warning Using GWL_USERDATA in Win32s

PSS ID Number: 147433

Article Last Modified on 3/9/1999


The information in this article applies to:


This article was previously published under Q147433

SYMPTOMS

If an application uses SetWindowLong() with GWL_USERDATA in Win32s, then the debug version of Windows will issue warning messages saying that some window properties were not removed when the window is destroyed.

CAUSE

GWL_USERDATA is supported under Win32s, even though this feature is not available under Windows 3.x.

In Win32s, GWL_USERDATA is implemented by adding two window properties to the window, one per 16-bit property. These window properties are not removed by Win32s when the window is destroyed.

RESOLUTION

Even though Win32s does not remove the window properties, they are actually deleted by Windows upon application termination. No memory leak will occur from this problem, so it is safe to ignore the warning in most cases.

In the case where your application uses the GWL_USERDATA with a large number of windows, these window properties are not freed until the application terminates. A workaround or suggestion for such a situation would be to use WNDCLASS.cbWndExtra instead of GWL_USERDATA.

STATUS

This behavior is by design.

Additional query words: win32s gwl_userdata

Keywords: KB147433
Technology: kbWin32s130 kbWin32sSearch