Dialog Box Creation Fails If Text Starts w/ Character 255Last reviewed: July 22, 1997Article ID: Q66926 |
3.00 3.10
WINDOWS
kbprg
The information in this article applies to:
SUMMARYText strings in a dialog box resource cannot start with the character represented by the value 255 (0xFF). In the ANSI character set, this character is the letter "y" with a diaeresis mark, which is used primarily in Nordic languages. If Windows encounters this situation, a call to DialogBox() or CreateDialog() will fail. The following are two possible solutions:
MORE INFORMATIONWindows uses the number 255 to indicate that a resource is represented by ordinal value instead of by a string name. For example, when a dialog box is declared as follows
AboutBox DIALOG ...the text "AboutBox" appears in the .RES file. However, using the following
1 DIALOG ...places the bytes 0xFF 0x01 0x00 into the .RES file. The 0xFF is used to indicate that the next two bytes are the ordinal value for this resource. When creating a dialog box, the Windows Dialog Manager scans through each string in the dialog box template to find the null terminator. However, when a string that starts with 255 is encountered, it is interpreted as an ordinal value. In this situation, Windows incorrectly skips the next 2 bytes and treats the new position as the next piece of data in the dialog box template. Whenever this occurs, the remainder of the dialog box template is interpreted incorrectly, and Windows tries to create controls of unknown classes, with unknown styles, in unknown locations. This causes the dialog box creation to fail. For additional information about dialog box creation failure reasons, query on the following words in the Microsoft Knowledge Base:
createdialog and createdialogindirect and dialogbox and creation |
Additional reference words: 3.00 3.10 dialog box ANSI
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |