Avoid reserved IDs in Symbian resource file enumerations (Known Issue)
hamishwillee
(Talk | contribs) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Add Abstract. Tidy wiki text.) |
||
| Line 1: | Line 1: | ||
| − | + | [[Category:Symbian C++]][[Category:UI]] | |
| − | [[Category:Symbian C++]] | + | {{Abstract|Symbian C++ apps that set resource file UI menu item command IDs and dialog item ID values of 0 will cause problems which may be hard to identify and debug.}} |
| − | [[Category:UI]] | + | |
{{ArticleMetaData <!-- v1.2 --> | {{ArticleMetaData <!-- v1.2 --> | ||
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
| Line 24: | Line 23: | ||
|author= [[User:Technical writer 1]] | |author= [[User:Technical writer 1]] | ||
<!-- The following are not in current metadata --> | <!-- The following are not in current metadata --> | ||
| − | |||
|id= TSS000199 | |id= TSS000199 | ||
}} | }} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==Detailed description== | ==Detailed description== | ||
| − | Menu item (RESOURCE MENU_ITEM) command IDs and dialog item (RESOURCE DLG_LINE) will cause problems which may be hard to identify and debug if 0 is used as the ID value. | + | Menu item ({{Icode|RESOURCE MENU_ITEM}}) command IDs and dialog item ({{Icode|RESOURCE DLG_LINE}}) will cause problems which may be hard to identify and debug if 0 is used as the ID value. |
| − | + | ||
==Solution== | ==Solution== | ||
| − | Always use a non-zero value for MENU_ITEM command IDs, because 0 is reserved for the {{Icode|EEikCmdCanceled}} command. | + | Always use a non-zero value for {{Icode|MENU_ITEM}} command IDs, because 0 is reserved for the {{Icode|EEikCmdCanceled}} command. |
Similarly, a dialog's item (DLG_LINE) IDs must be non-zero. Dialog items with a zero ID will result in "Eikon-Dialog 3" panic, where 3 is listed as {{Icode|EEikDialogPanicFocusableLineWithIdZero}}. | Similarly, a dialog's item (DLG_LINE) IDs must be non-zero. Dialog items with a zero ID will result in "Eikon-Dialog 3" panic, where 3 is listed as {{Icode|EEikDialogPanicFocusableLineWithIdZero}}. | ||
Typically, applications define resource ID values as enumerations and a common mistake is to begin the enumeration from 0 (default), which leads to these hard-to-identify problems. | Typically, applications define resource ID values as enumerations and a common mistake is to begin the enumeration from 0 (default), which leads to these hard-to-identify problems. | ||
| + | |||
<!-- Translation --> [[zh-hans:防止资源文件枚举值中出现保留ID值]] | <!-- Translation --> [[zh-hans:防止资源文件枚举值中出现保留ID值]] | ||
Latest revision as of 07:41, 12 March 2012
Symbian C++ apps that set resource file UI menu item command IDs and dialog item ID values of 0 will cause problems which may be hard to identify and debug.
Article Metadata
Compatibility
Article
Detailed description
Menu item (RESOURCE MENU_ITEM) command IDs and dialog item (RESOURCE DLG_LINE) will cause problems which may be hard to identify and debug if 0 is used as the ID value.
Solution
Always use a non-zero value for MENU_ITEM command IDs, because 0 is reserved for the EEikCmdCanceled command.
Similarly, a dialog's item (DLG_LINE) IDs must be non-zero. Dialog items with a zero ID will result in "Eikon-Dialog 3" panic, where 3 is listed as EEikDialogPanicFocusableLineWithIdZero.
Typically, applications define resource ID values as enumerations and a common mistake is to begin the enumeration from 0 (default), which leads to these hard-to-identify problems.

