You Are Here:

Community: Developer Discussion Boards

#1 Old To liuxg, ask for more!谢谢! - 2003-05-15, 03:51

Join Date: May 2003
Posts: 63
fengwangjiang
Offline
Regular Contributor
首先感谢你的指点!
上次那个出现异常的问题,我终于定位错误在从资源中创建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

再次感谢你!
Reply With Quote

#2 Old more strange!!! - 2003-05-15, 10:49

Join Date: May 2003
Posts: 63
fengwangjiang
Offline
Regular Contributor
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!
Reply With Quote

#3 Old 2003-05-16, 04:01

Join Date: Mar 2003
Posts: 3,175
Location: Beijing
Send a message via MSN to liuxg
liuxg's Avatar
liuxg
Offline
Forum Nokia Expert
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
Attached Files
File Type: zip test.zip (20.3 KB, 299 views)
Last edited by liuxg : 2003-05-16 at 05:01.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia