Microsoft KB Archive/67243

INF: Custom Control Documentation Errors ID Number: Q67243

3.00 MS-DOS docerr

Summary:

The following is a list of documentation errors in chapter 20 of the “Microsoft Windows Software Development Kit Guide to Programming” version 3.0:

  Page 20-11: Table of exported functions and their ordinal values is misleading. It is not necessary to export the ClassInit [or LibMain] function. This function is called only once when the DLL is loaded and is not called by the Dialog Editor or by any other application. The ClassWndFn function is the window procedure of the control class. While this function must be exported, it is not necessary to associate the ordinal value 5 with it. The ClassWndFn may be exported as any ordinal except 2, 3, 4, or 6.   Page 20-13: CTLTYPE pointer types not declared. On this page, and in the Windows SDK include file CUSTCNTL.H, there are no definitions of the various types of pointers to the CTLTYPE structure. The following additional type declarations should be included: typedef CTLTYPE * PCTLTYPE; typedef CTLTYPE FAR * LPCTLTYPE;   Page 20-15: hCtlStyle parameter to ClassStyle function is a handle to global memory. The hCtlStyle parameter to the ClassStyle function should be documented as a HANDLE to global memory. The ClassStyle function must call GlobalLock on this handle to access the data, and must call GlobalUnlock when the data is no longer needed.   Page 20-16: Documentation for the dwStyle field in the CTLSTYLE structure is incorrect. The documentation for the dwStyle field incorrectly states that “The high-order word contains the control specific flags, while the low-order word contains the Windows-specific flags.” The statement in the documentation is backwards. The Windows-specific flags are contained in the high-order word, and the control-specific flags are contained in the low-order word.   Page 20-18: Documentation for the dwFlags parameter to the ClassFlags function is incorrect. The first parameter of the ClassFlags function is documented as a DWORD, dwFlags. The first parameter is actually a WORD parameter, wFlags. wFlags contains only the control-specific flags. The Rainbow sample code provided in the SDK correctly uses a WORD value. The description of the ClassFlags function incorrectly states that “This function should not interpret the flags contained in the high-order word since these are managed by the Dialog Editor.” There is no need for this statement because there is no high-order word.   Page 20-18: Documentation for the wMaxString parameter to the ClassFlags function is incorrect. The documentation for this parameter states that this parameter “Specifies the maximum length of the style ring.” The last word should be “string.” 