The information in this article applies to:
SYMPTOMSUnder Windows 95, a call to RegisterClass() or RegisterClassEx() returns NULL if a value greater than 40 is specified for the cbWndExtra or cbClsExtra members of the WNDCLASS or WNDCLASSEX structure. CAUSEWindows 95 checks to see if cbWndExtra or cbClsExtra is greater than 40. If so, it outputs these debug messages and returns NULL to indicate failure:
RESOLUTIONIf more than 40 bytes are needed to store window-specific or class-specific information, an application should allocate memory. Then set the cbWndExtra or cbClsExtra to 4 bytes, and pass the pointer to the allocated memory by using SetClassLong() as follows:
The pointer can then be retrieved when needed by using GetClassLong() as
follows:
STATUSThis behavior is by design. However, as of version 3.51, Windows NT does not have this 40-byte limitation. Additional query words:
Keywords : kbGrpUser kbWinOS95 kbWndw kbWndwClass |
Last Reviewed: December 7, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |