All About Symbian - Nokia (S60) and Sony Ericsson (UIQ) smartphones unwrapped

  #1  
Old 05-03-2003, 08:08 PM
dashfly dashfly is offline
Registered User
 
Join Date: Feb 2003
Posts: 4
dashfly is on a distinguished road
ListBox woes (KERN-EXEC 3)

Hi,

I'm wondering someone can help me with a ListBox problem. I'm trying to construct and display a ListBox in the container of my application. The ConstructL function looks like:

void CLbtestContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();

iListBox = new (ELeave) CAknSingleStyleListBox;
iListBox->SetContainerWindowL(*this);
iListBox->ConstructL(this, EAknListBoxSelectionList);

array = new (ELeave) CDesCArrayFlat(5);
array->AppendL(_L("\tItem1"));
array->AppendL(_L("\tItem2"));
array->AppendL(_L("\tItem3"));
array->AppendL(_L("\tItem4"));
array->AppendL(_L("\tItem5"));
iListBox->Model()->SetItemTextArray(array);

iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOf f, CEikScrollBarFrame::EAuto);


SetRect(aRect);
ActivateL();
}

Everything compiles fine but when I run it in the emulator it instantly crashes. When I run it on my target device (3650) it immediately exits with a KERN-EXEC 3 panic. I've looked up the panic message but I'm still lost on what could be causing the problem. I would appreciate any feedback you can give. Thank you!

Regards,
Dennis
Ads

  #2  
Old 05-03-2003, 11:15 PM
emunator emunator is offline
Registered User
 
Join Date: Dec 2002
Posts: 5
emunator is on a distinguished road
What does your
TInt CLbtestContainer::CountComponentControls() const
{
return 1; // return nbr of controls inside this container
}

and

CCoeControl* CLbtestContainer::ComponentControl(TInt aIndex) const
{
if (aIndex == 0)
return iListBox;
return NULL;
}

say?

Best regards,
Teemu Moilanen

  #3  
Old 06-03-2003, 07:07 AM
cmatthee's Avatar
cmatthee cmatthee is offline
Registered User
 
Join Date: May 2002
Posts: 163
cmatthee is on a distinguished road
First of all, let me start by saying that I don't know the CAknSingleStyleListBox class at all. It is not part of my sdk. But, having said that, here are some questions and a suggestion.

1. What is the exact definition of CAknSingleStyleListBox::ConstructL ?
2. What is the class name of the model used by the listbox ? (e.g. CTextListBoxModel)
3. Is the listbox constructing the model, or do you need to do it ?

I would suggest that you change the following code from
[code:1]array = new (ELeave) CDesCArrayFlat(5);
array->AppendL(_L("\tItem1"));
array->AppendL(_L("\tItem2"));
array->AppendL(_L("\tItem3"));
array->AppendL(_L("\tItem4"));
array->AppendL(_L("\tItem5"));
iListBox->Model()->SetItemTextArray(array); [/code:1]
to [code:1]CDesCArray* array = (CDesCArray*)iListBox->Model()->ItemTextArray();
array->AppendL(_L("\tItem1"));
array->AppendL(_L("\tItem2"));
array->AppendL(_L("\tItem3"));
array->AppendL(_L("\tItem4"));
array->AppendL(_L("\tItem5")); [/code:1]
__________________
The box said Windows 98 or better. Why is it not working on FreeBSD?

  #4  
Old 06-03-2003, 11:31 AM
Mental Blank Mental Blank is offline
Registered User
 
Join Date: Sep 2002
Posts: 82
Mental Blank is on a distinguished road
A couple of things to try:

1. Swap the ConstructL() and SetContainerWindowL() lines around.

2. Add the line
[code:1]iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);[/code:1]
before calling SetItemTextArray().

  #5  
Old 11-03-2003, 01:01 AM
dashfly dashfly is offline
Registered User
 
Join Date: Feb 2003
Posts: 4
dashfly is on a distinguished road
Thanks for the great responses and I did finally come to a solution and it was what emunator suggested. My ComponentControl function was still referencing the default labels inserted by the AppWizard. Thanks for taking the time to help a newbie out and I'm glad to be a part of these great forums!

Regards,
Dennis

  #6  
Old 24-07-2006, 10:45 AM
ckp21082 ckp21082 is offline
Registered User
 
Join Date: Jul 2006
Posts: 3
ckp21082 is on a distinguished road
Quote:
Hi,

I'm wondering someone can help me with a ListBox problem. I'm trying to construct and display a ListBox in the container of my application. The ConstructL function looks like:

void CLbtestContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();

iListBox = new (ELeave) CAknSingleStyleListBox;
iListBox->SetContainerWindowL(*this);
iListBox->ConstructL(this, EAknListBoxSelectionList);

array = new (ELeave) CDesCArrayFlat(5);
array->AppendL(_L("\tItem1"));
array->AppendL(_L("\tItem2"));
array->AppendL(_L("\tItem3"));
array->AppendL(_L("\tItem4"));
array->AppendL(_L("\tItem5"));
iListBox->Model()->SetItemTextArray(array);

iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOf f, CEikScrollBarFrame::EAuto);


SetRect(aRect);
ActivateL();
}

Everything compiles fine but when I run it in the emulator it instantly crashes. When I run it on my target device (3650) it immediately exits with a KERN-EXEC 3 panic. I've looked up the panic message but I'm still lost on what could be causing the problem. I would appreciate any feedback you can give. Thank you!

Regards,
Dennis
can any body tell me which library is used to access listbox controll for class CAknSingleStyleListBox

i got an error
c:\Symbian\7.0s\Series60_v20\Epoc32\CarSample\inc\ CarSampleContainer.h(87): error C2079: 'CCarSampleContainer::iListBox' uses undefined class 'CAknSingleStyleListBox'

c:\Symbian\7.0s\Series60_v20\Epoc32\CarSample\src\ CarSampleAppUi.cpp(188): error C2065: 'array' : undeclared identifier

but If i declare
class CAknSingleStyleListBox; // For List Box
class CDesCArrayFlat; // Array

then it will reduce error list and return few errors like

C:\Symbian\7.0s\Series60_v20\\Epoc32\include\bades ca.h(213): error C2371: 'CDesCArrayFlat' : redefinition; different basic types

c:\Symbian\7.0s\Series60_v20\Epoc32\CarSample\inc\ CarSampleContainer.h(21): fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information


can anybody solve my problem so i can provide me solution as early as possible.


I want to read contact numbers and put it into listbox for display
can anybody tell me how can i do this ?

Thank you.
Chirag
 

Bookmarks

Tags
kernexec, listbox, woes

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT. The time now is 01:14 PM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright Notes || Contact Us || Privacy Policy