| Reply | « Previous Thread | Next Thread » |
|
首先感谢你的指点!
上次那个出现异常的问题,我终于定位错误在从资源中创建LISTBOX的代码上, 但是我还是没有发现错误,所以想再次请教一下。 void CNavboytestContainer::ConstructL(const TRect& aRect) { CreateWindowL(); iMainMenuListBox = new (ELeave) CAknSingleStyleListBox( ); TResourceReader reader; CEikonEnv::Static()->CreateResourceReaderLC(reader, R_NAVBOYTEST_MAINMENU_SINGLE);!!! 我只要一加上这句话( CEikonEnv::Static()->CreateResourceReaderLC(reader, R_NAVBOYTEST_MAINMENU_SINGLE); ), 重新编译后,运行EMULATOR,就出现异常:双击程序图标后,弹出一个WINDOW 的警告对话框: “应用程序发生异常unknown software exception (0x80000003),位置在0x6001bb22。 在确定上单击,中止应用程序 在取消上单击,调试应用程序”,但是如果不加上这句话程序就不会出现异常。 以下是我的资源文件:(LISTBOX的资源我加在最后的) navboy.rss /* * ============================================================================ * Name : navboytest.rss * Part of : navboytest * Created : 03-05-14 by fengwangjiang * Description: * This file contains all the resources for the navboytest. * Initial content was generated by Series 60 AppWizard. * Version : * Copyright: haoning * ============================================================================ */ // RESOURCE IDENTIFIER NAME AWIZ // 4 letter ID // INCLUDES #include <eikon.rh> #include "navboytest.hrh" #include "navboytest.loc" #include <avkon.rsg> #include <avkon.rh> #include <avkon.mbg> // CONSTANTS //#define ?constant ?value //CHARACTER_SET UTF8 // MACROS //#define ?macro // RESOURCE DEFINITIONS RESOURCE RSS_SIGNATURE { } RESOURCE TBUF { buf="navboytest"; } RESOURCE EIK_APP_INFO { status_pane = r_navboytest_status_pane; } //---------------------------------------------------- // // r_navboytest_hotkeys // ?description // //---------------------------------------------------- // RESOURCE HOTKEYS r_navboytest_hotkeys { control= { HOTKEY { command=EAknCmdExit; key='e'; } }; } //---------------------------------------------------- // // r_navboytest_view1 // ?description // //---------------------------------------------------- // RESOURCE AVKON_VIEW r_navboytest_view1 { hotkeys=r_navboytest_hotkeys; //menubar=r_navboytest_menubar_view1; cba=R_AVKON_SOFTKEYS_OK_BACK; } //---------------------------------------------------- // // r_navboytest_menubar_view1 // ?description // //---------------------------------------------------- // RESOURCE MENU_BAR r_navboytest_menubar_view1 { titles= { MENU_TITLE { menu_pane=r_navboytest_app_menu; txt="App"; }, MENU_TITLE { menu_pane=r_navboytest_view1_menu; txt="View"; } }; } //---------------------------------------------------- // // r_navboytest_view1_menu // ?description // //---------------------------------------------------- // RESOURCE MENU_PANE r_navboytest_view1_menu { items= { MENU_ITEM { command=EnavboytestCmdAppTest; txt = qtn_view1_option_item; } }; } //---------------------------------------------------- // // r_navboytest_view2 // ?description // //---------------------------------------------------- // RESOURCE AVKON_VIEW r_navboytest_view2 { hotkeys=r_navboytest_hotkeys; menubar=r_navboytest_menubar_view2; cba=R_AVKON_SOFTKEYS_SELECTION_LIST; } //---------------------------------------------------- // // r_navboytest_menubar_view2 // ?description // //---------------------------------------------------- // RESOURCE MENU_BAR r_navboytest_menubar_view2 { titles= { MENU_TITLE { menu_pane=r_navboytest_app_menu; txt="App"; }, MENU_TITLE { menu_pane=r_navboytest_view2_menu; txt="View"; } }; } //---------------------------------------------------- // // r_navboytest_view2_menu // ?description // //---------------------------------------------------- // RESOURCE MENU_PANE r_navboytest_view2_menu { items= { MENU_ITEM { command=EnavboytestCmdAppTest; txt = qtn_view2_option_item; } }; } //---------------------------------------------------- // // r_navboytest_app_menu // ?description // //---------------------------------------------------- // RESOURCE MENU_PANE r_navboytest_app_menu { items= { MENU_ITEM { command=EnavboytestCmdAppTest; txt = qtn_appl_option_item; }, MENU_ITEM { command=EAknCmdExit; txt="Exit"; } }; } RESOURCE STATUS_PANE_APP_MODEL r_navboytest_status_pane { panes= { SPANE_PANE { id = EEikStatusPaneUidNavi; type = EAknCtNaviPane; resource = r_navboytest_navi_decorator; } }; } //---------------------------------------------------- // // r_navboytest_navi_decorator // ?description // //---------------------------------------------------- // RESOURCE NAVI_DECORATOR r_navboytest_navi_decorator { type = ENaviDecoratorControlTabGroup; control = TAB_GROUP { tab_width = EAknTabWidthWithTwoTabs; // two tabs active = 0; tabs = { TAB { id = EnavboytestView1Tab; // from application hrh txt = qtn_view1_tab; }, TAB { id = EnavboytestView2Tab; txt = qtn_view2_tab; } }; }; } RESOURCE ARRAY r_navboy_mainmenu_item_single { items = { LBUF { txt = "\taaa"; } }; } RESOURCE LISTBOX r_navboytest_mainmenu_single { array_id = r_navboy_mainmenu_item_single; flags = EAknListBoxSelectionList; } // End of File 再次感谢你! |
| fengwangjiang |
| View Public Profile |
| Find all posts by fengwangjiang |
|
another more strange question occurs,i remove all the codes about listbox setup and add code line by line .
it happens that exception occurs if i add "iListBox = new(ELeave) CAknSingleStyleListBox()". like the following: 弹出一个WINDOW 的警告对话框: “应用程序发生异常unknown software exception (0x80000003),位置在0x6001bb22。 在确定上单击,中止应用程序 在取消上单击,调试应用程序”, 但是如果不加上这句话程序就不会出现异常。 MORE STRANGE!!! it bothers me so much! thank very much! |
| fengwangjiang |
| View Public Profile |
| Find all posts by fengwangjiang |
|
Hi,
It seems strange to me as well. I cannot see any problems in your code. This is because I cannot see the whole picture of your code. There must be something wrong in other places!!! I have tried to use your method in my place, and I have constructed a sample code, demonstrating how to contruct a listbox. Should you experience any problems with the code, please let me know. From the code, you can see that I have no problem at all!!!! For your information, there is a sample code located in the SDK at the following location: \Symbian\6.1\Series60\Series60Ex\ListBox I think it provides you a good start to program a listbox control. Hope this help! Liuxg Forum Nokia
Last edited by liuxg : 2003-05-16 at 05:01.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |