×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    how to remove this error....in container.app

    hi2 all
    now that prblem is solved(i again went in recycle bin and restored the deleted .rsg file then it was builded successfully) but the new prblem is that ki when i am compiling my code and builded it my application first shows the blank screen for few seconds and then emulator automatically closec.

    this is my container class modified code.

    void CSMSExampleRTEContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    SetRect(aRect);
    iRte = CRichTextEditorRTE::NewL();

    TResourceReader reader;
    iEikonEnv->CreateResourceReaderLC(reader,R_LIST_LISTBOX);
    iListBox->ConstructFromResourceL(reader);
    ActivateL();
    CleanupStack::PopAndDestroy(); // reader
    SizeChanged();
    }

    CSMSExampleRTEContainer::~CSMSExampleRTEContainer()
    {
    delete iRte;
    iRte = 0;
    }

    void CSMSExampleRTEContainer::SizeChanged()
    {
    iListBox->SetExtent (TPoint(0,0), iListBox->MinimumSize());
    }

    TInt CSMSExampleRTEContainer::CountComponentControls() const
    {
    return 1; // return number of controls inside this container
    }

    CCoeControl* CSMSExampleRTEContainer::ComponentControl(TInt aIndex) const
    {
    switch ( aIndex )
    {
    case 0:
    return iListBox;
    default:
    return NULL;
    }
    }


    void CSMSExampleRTEContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear(aRect);
    }

    void CSMSExampleRTEContainer::HandleControlEventL(
    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
    {
    }
    TKeyResponse CSMSExampleRTEContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    if (iRte)
    return iRte->OfferKeyEventL(aKeyEvent, aType);
    else
    return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
    }
    void CSMSExampleRTEContainer::PlaySelectedGame(TInt /*aOpenedItem*/)
    {
    }


    what should i do now?

    awaiting your valuable reply......

  2. #2
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to remove this error....in container.app

    TRy to debug the application and check what panic code you get..
    search for the details related to the panic code.search in the sdk and also out here in FN.
    if you are still stuck post it out here.it saves much of your time dude..

    Priju

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    37

    Re: how to remove this error....in container.app

    You're missing iListbox->SetContainerWindowL(*this); from ConstructL(). You might also want to remove SizeChanged from ConstructL, as it is called automatically. Also, maybe move ActivateL() as the last line in the ConstructL and place SetRect just before it.

  4. #4
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to remove this error....in container.app

    hi 2 all

    i have moved activateL at last and i putted setrect just before that
    and i cant able 2 cal iListbox->SetContainerWindowL(*this);
    because only CCoecontrol derived class is able 2 cal this method and iListbox objects class is not CCoecontrol derived.
    and I removed sizechange method

    till i am facing the same prblem.

    do u hav any suggestion?

    awaiting your valuable reply.

    regards
    bharat

  5. #5
    Super Contributor
    Join Date
    May 2005
    Location
    Hyderabad,India
    Posts
    704

    Re: how to remove this error....in container.app

    Hi,

    Do like this,

    First initialize ur listbox with CAknSingleStyleListBox or any other listbox style.

    Code:
    iListBox =  new(ELeave)  CAknSingleStyleListBox;
    iListBox->SetContainerWindowL(*this);
    TResourceReader reader;
    iEikonEnv->CreateResourceReaderLC(reader,R_LIST_LISTBOX);
    iListBox->ConstructFromResourceL(reader);
    iListBox->ActivateL();
    CleanupStack::PopAndDestroy(); // reader
    And in OfferKeyEventL() function,

    if(iRte)
    return iRte->OfferKeyEventL(aKeyEvent,aType);
    if(iListBox)
    return iListBox->OfferKeyEventL(aKeyEvent,aType);

    And in SizeChanged() function

    if(iRte)
    iRte->SetExtent(TPoint(0,0),iRte->MinimumSize());
    if(iListBox)
    iListBox->SetExtent(TPoint(0,0),iListBox->MinimumSize());

    And change in CountComponentControls() and ComponentControl() functions also.

    regards,
    eswar

  6. #6
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to remove this error....in container.app

    thanks eswar,

    i have made the changes according to you.
    now my emulator dosent dies but when i opens my application it is not showing any screens.
    it just shows the same screen where all applications along with icons are shown.

    means my privious view dosent changes.

    awaiting for your valuable reply

    regards
    bharat

  7. #7
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to remove this error....in container.app

    hi 2 all

    does anyone has the suggetion for this.
    i am really stucked at this.

    awaiting your valuable reply.

    regards
    bharat

  8. #8
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: how to remove this error....in container.app

    hi
    Bharat


    did u made changes in CountComponentControls() and componentcontrols() functions

    regards n bye
    Giridhar

  9. #9
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to remove this error....in container.app

    hi giridher,

    thanks for reply.

    yah i hav made changes in these two functions.
    these are given below.

    TInt CSMSExampleRTEContainer::CountComponentControls() const
    {
    return 2; // return number of controls inside this container
    }


    CCoeControl* CSMSExampleRTEContainer::ComponentControl(TInt aIndex) const
    {
    switch ( aIndex )
    {
    case 0:
    return iRte;
    case 1:
    return iListBox;
    default:
    return NULL;
    }
    }


    is it right?if not plz suggest me the right changes.

    regards
    bharat

  10. #10
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to remove this error....in container.app

    Hi barath,
    your CountComponentControls() and ComponentControl() looks fine to me.( hope you have got two controls, ie.. richtextbox and a listbox).

    like to know whats the panic code.usually the controls wont be shown in the container if the ComponentControls has a wrong count.but in your case i find it done pretty fine.please mention the panic code in your next post.

    Priju

  11. #11
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to remove this error....in container.app

    hi priju
    thanks for reply.

    actually i am not getting any error now.
    i want my listbox to be shown on the first screen.but instead it is not showing the listbox it is showing the same main emulator screen from which i have selected my application with my two soft keys.
    and when i pressed any softkey i am seeing the same menus which i have set for first screen.

    awaiting your valuable reply.

    regards
    bharat

  12. #12
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: how to remove this error....in container.app

    is it possible for u to send ur code....


    regards
    N

  13. #13
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to remove this error....in container.app

    yah sure...
    this is my container.app class

    #include "SMSExampleRTEContainer.h"
    #include "SMSExamplerichtexteditorrte.h"
    #include <stringloader.h>
    #include <aknselectionlist.h>
    #include <akniconarray.h>
    #include <barsread.h>
    #include <SmsExample.rsg>

    CSMSExampleRTEContainer* CSMSExampleRTEContainer::NewL(const TRect& aRect)
    {
    CSMSExampleRTEContainer* self = CSMSExampleRTEContainer::NewLC(aRect);
    CleanupStack::Pop(self);
    return self;
    }

    CSMSExampleRTEContainer* CSMSExampleRTEContainer::NewLC(const TRect& aRect)
    {
    CSMSExampleRTEContainer* self = new (ELeave) CSMSExampleRTEContainer;
    CleanupStack::PushL(self);
    self->ConstructL(aRect);
    return self;
    }

    void CSMSExampleRTEContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    iRte = CRichTextEditorRTE::NewL();
    iRte->SetContainerWindowL(*this);
    iListBox = new(ELeave) CAknSingleStyleListBox;
    iListBox->SetContainerWindowL(*this);

    TResourceReader reader;
    iEikonEnv->CreateResourceReaderLC(reader,R_LIST_LISTBOX);
    iListBox->ConstructFromResourceL(reader);
    SetRect(aRect);
    CleanupStack::PopAndDestroy(); // reader
    iListBox->ActivateL();
    }

    CSMSExampleRTEContainer::~CSMSExampleRTEContainer()
    {
    delete iRte;
    delete iListBox;
    iRte = 0;
    }

    void CSMSExampleRTEContainer::SizeChanged()
    {
    if(iRte)
    iRte->SetExtent(TPoint(0,0),iRte->MinimumSize());
    if(iListBox)
    iListBox->SetExtent(TPoint(0,0),iListBox->MinimumSize());
    }

    TInt CSMSExampleRTEContainer::CountComponentControls() const
    {
    return 2; // return number of controls inside this container
    }

    CCoeControl* CSMSExampleRTEContainer::ComponentControl(TInt aIndex) const
    {
    switch ( aIndex )
    {
    case 0:
    return iRte;
    case 1:
    return iListBox;
    default:
    return NULL;
    }
    }

    void CSMSExampleRTEContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear(aRect);
    }

    void CSMSExampleRTEContainer::HandleControlEventL(
    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
    {
    }

    TKeyResponse CSMSExampleRTEContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    if (iRte)
    return iRte->OfferKeyEventL(aKeyEvent, aType);
    if(iListBox)
    return iListBox->OfferKeyEventL(aKeyEvent, aType);
    }

    void CSMSExampleRTEContainer::PlaySelectedGame(TInt /*aOpenedItem*/)
    {
    }


    it is compiling successfully.

    awaiting for your valuable reply.

    regards
    bharat

  14. #14
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to remove this error....in container.app

    Are you appending the correctly formatted items onto the list box.
    If the format is wrong the list box items wouldnt be shown.
    Check that.
    And also you could try commenting your richtexteditors codes, and try for the listbox only.i think the richtexteditor is overlapping your listbox as for both you have set the same size and points.

    Priju

  15. #15
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: how to remove this error....in container.app

    Hi Bharat!

    U try out wt giridharn n Priju Jacob Paul are saying.

    I will advise u to go with only list control initially as Priju says.

    At the same time see the listbox example from sdk.
    crosscheck everything 1s again.

    Tryin ur Draw(-)

    gc.DrawRect( aRect );

    instead of Clearing the whole window.

    Also call
    iListBox->DrawNow(); after iListBox->ActivateL();

    call SetRect(aRect); after iListBox->ActivateL() and iListBox->DrawNow()

    I think u r breaking the sequence.

    Hope this helps u.
    Regards,
    Shilpa Kulkarni

Similar Threads

  1. Replies: 2
    Last Post: 2006-04-12, 11:52
  2. Remove contact Using JSR 75 for Nokia 6230i Device
    By sirishak in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-04-06, 08:30
  3. How to remove menu?
    By silverparasol in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-08-09, 09:43
  4. 6600 - fails to remove package
    By dchiaramello in forum Symbian
    Replies: 4
    Last Post: 2004-02-25, 17:17
  5. Can't remove application
    By vphong in forum Symbian
    Replies: 1
    Last Post: 2002-12-31, 04:49

Posting Permissions

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