c++ - 带有 LISTBOX 的对话框应用程序

标签 c++ symbian

我正在创建一个 S60 应用程序,它将有一个主对话框和一个包含 5 个左右项目的列表框。

但是当我尝试在模拟器上运行应用程序时,我不断收到一条消息:“应用程序 app1 已关闭”。

这是我的资源文件(app1.rss)内容:

RESOURCE DIALOG r_dialog
    {
    flags=EAknDialogSelectionList;
    buttons=R_AVKON_SOFTKEYS_OPTIONS_EXIT; 
    items=
        {

        DLG_LINE
            {
            id=EPowerSMSDlg1Label;
            type=EAknCtSingleGraphicListBox;
            control= LISTBOX 
                { 
                flags = EAknListBoxSelectionList;
                array_id=array0;
                };
            },

              DLG_LINE

                 {

                 itemflags = EEikDlgItemNonFocusing;

                 id = EFindControl;

                 type = EAknCtSelectionListFixedFind;

                 }


        };
    }


RESOURCE ARRAY array0
{
    items=
        {

            LBUF { txt="Events Log"; }

        };
}

我做错了什么?

最佳答案

您正在经历 panic 。你应该enable extended panic code查看您遇到的是哪种 panic ,然后引用 system panic reference documentation看看它是什么意思。

在这种特殊情况下,至少您的列表框项目格式不正确。 EAknCtSingleGraphicListBox 枚举值对应于 CAknSingleGraphicStyleListBox 类和 its documentation指出

list item string format: "0\tTextLabel\t1\t2" where 0,1,2 are index to the icon array

您的项目文本缺少制表符分隔符。

关于c++ - 带有 LISTBOX 的对话框应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1917590/

相关文章:

Qt:以编程方式定义 Tab Order

c++ - TCP/IP 的套接字写入问题

c++ - 用另一个函数替换 WndProc 来处理消息?

c++ - 如何检查发送方是否发送了 UDP 数据包

.net - 适用于 .NET WCF、.NET CF、Android、Symbian 的跨平台 AES 加密

c++ - TBuf 到 TInt Symbian

c++ - 如何使用 ctypes 将数组从 C++ 函数返回到 Python

c++ - R 到 C++ : Rcpp - Combinatorial example

c++ - 运行时错误: "*** glibc detected ***: double free or corruption (out)"

qt - QListWidget 拖放项目从 Symbian 列表中消失