×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    67

    ActivateL in the view creating a problem

    Hello,


    I am writing an application in which i am intercepting a incomming GSM call and showing the number of the incomming call.

    Before th GSM call arrives my view is different and as soon as there is an incomming GSM call i retrive the number and show it in a list box in a different view.Following is the code of the listbox view.




    // INCLUDE FILES
    #include <coemain.h>
    #include <aknlists.h>
    #include <badesca.h>
    #include "CallingViewAppView.h"
    #include "SampleAppUi.h"
    #include <Sample_0xEC7B4304.rsg>
    #include <aknquerydialog.h>
    #include <eikenv.h>
    #define KListPosition TPoint(0,0)
    // ============================ MEMBER FUNCTIONS ===============================

    // -----------------------------------------------------------------------------
    // CCallingViewAppView::NewL()
    // Two-phased constructor.
    // -----------------------------------------------------------------------------
    //
    CCallingViewAppView* CCallingViewAppView::NewL( const TRect& aRect,CSampleAppUi* iAppUi )
    {
    CCallingViewAppView* self = CCallingViewAppView::NewLC( aRect,iAppUi );
    CleanupStack::Pop( self );
    return self;
    }

    // -----------------------------------------------------------------------------
    // CCallingViewAppView::NewLC()
    // Two-phased constructor.
    // -----------------------------------------------------------------------------
    //
    CCallingViewAppView* CCallingViewAppView::NewLC( const TRect& aRect,CSampleAppUi* iAppUi )
    {
    CCallingViewAppView* self = new ( ELeave ) CCallingViewAppView;
    CleanupStack::PushL( self );
    self->ConstructL( aRect,iAppUi );
    return self;
    }

    // -----------------------------------------------------------------------------
    // CCallingViewAppView::ConstructL()
    // Symbian 2nd phase constructor can leave.
    // -----------------------------------------------------------------------------
    //
    void CCallingViewAppView::ConstructL( const TRect& aRect,CSampleAppUi* iAppUi )
    {
    // Create a window for this application view
    CreateWindowL();
    appUI=iAppUi;
    list = new (ELeave) CAknDoubleStyleListBox;
    SFW::LogMe(_L8("List Box created\r\n"));
    // construct listbox
    list->ConstructL(this,0);
    queryBoxFlag=ETrue;
    // set container control
    list->SetContainerWindowL(*this);

    list->SetListBoxObserver(this);
    // add scrollbars to listbox
    list->CreateScrollBarFrameL(ETrue);

    list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );

    _LIT(KListItemFormat, "\t%S\t%S\t");
    _LIT(KListDialled,"Calling....");
    _LIT(KListIncoming,"Incoming Call....");
    _LIT(KSubString,"Number");

    // construct listbox item array

    CDesCArray* itemList = static_cast<CDesCArray*>(list->Model()->ItemTextArray());
    itemList->Reset();
    TBuf<120> item;
    TBuf<30> itemName;
    TBuf<30> itemSubString;

    if(appUI->IsCalling)
    itemName.Copy(KListDialled);
    else if (appUI->GotCalled)
    itemName.Copy(KListIncoming);

    itemSubString.Copy(KSubString);
    TBuf<30>TargetIdNum=appUI->remoteId);
    item.Format(KListItemFormat, &itemName,&(TargetIdNum));

    itemList->AppendL(item);
    list->HandleItemAdditionL();
    list->SetCurrentItemIndex(0);

    // Set the windows size
    SetRect( aRect );


    // Activate the window, which makes it ready to be drawn
    ActivateL();
    }

    // -----------------------------------------------------------------------------
    // CCallingViewAppView::CCallingViewAppView()
    // C++ default constructor can NOT contain any code, that might leave.
    // -----------------------------------------------------------------------------
    //
    CCallingViewAppView::CCallingViewAppView()
    {
    // No implementation required
    }


    // -----------------------------------------------------------------------------
    // CCallingViewAppView::~CCallingViewAppView()
    // Destructor.
    // -----------------------------------------------------------------------------
    //
    CCallingViewAppView::~CCallingViewAppView()
    {
    delete list;
    }


    // -----------------------------------------------------------------------------
    // CCallingViewAppView:raw()
    // Draws the display.
    // -----------------------------------------------------------------------------
    //
    void CCallingViewAppView:raw( /*const TRect& aRect*/ ) const
    {
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect drawRect( Rect());

    // Clears the screen
    gc.Clear( drawRect );

    }

    void CCallingViewAppView::SizeChanged()
    {
    if(list)
    {
    list->SetExtent (KListPosition, list->MinimumSize());
    }
    }


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


    CCoeControl* CCallingViewAppView::ComponentControl(TInt aIndex) const
    {
    switch (aIndex)
    {
    case 0:
    if(list)
    {
    return list;
    }
    default:
    return NULL;
    }
    }


    TKeyResponse CCallingViewAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {

    if ( aType != EEventKey )
    {
    return EKeyWasNotConsumed;
    }

    if ( list )
    {
    return list->OfferKeyEventL( aKeyEvent, aType );
    }

    return EKeyWasNotConsumed;
    }



    void CCallingViewAppView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aListBoxEvent)
    {



    }

    // ---------------------------------------------------------
    // CAreciboPhoneBookView::HandleControlEventL()
    // ---------------------------------------------------------
    //
    void CCallingViewAppView::HandleControlEventL(
    CCoeControl* /*Control*/,TCoeEvent /*aEventType*/)
    {
    }


    TBool CCallingViewAppView::KeyCapturedL(TWsEvent aEvent)
    {

    }

    now many a times my application crashes at ActivateL function.It does not happen in all cases but it does happens after few calls,

    Can any body guess the reason behind it .It gives KERN - EXEC 3 while crashing.


    Regards
    symbiannil
    Last edited by symbiannil; 2008-10-03 at 09:47.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: ActivateL in the view creating a problem

    Hi,

    Could you post your DoActivateL() api of your CCallingViewAppView. I hope your CCallingViewAppView is derived from CAknView
    Regards,
    Sriky

Similar Threads

  1. Replies: 0
    Last Post: 2008-01-29, 12:53
  2. Problems creating view from CEikListBox
    By kamenlitchev in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-12-22, 21:18
  3. CBA problem in fullscreen view
    By iulian_moldovan in forum Symbian
    Replies: 2
    Last Post: 2006-06-01, 12:55
  4. Problem during creating .jar file in JBuilder
    By sachinwarang in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-04-17, 15:06
  5. Problem with bldmake bldfiles for Series 60 SDK 6.1
    By dml in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 1970-01-01, 02:00

Posting Permissions

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