×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    series60 cameraApp

    Hi,

    i am extending the CameraApp application, where i include an extra option "XYZ" in the main menu and when it is selected i want to display a new screen with som options.. in order to do this i created another view class and declared all the appropriate methods like DoActivateL(), DoDeActiveteL(),Id(),HandleClientRectChange()..

    i jus tested whether it is working till here by displaying the view with a line drawn on the screen. I created another Container class where it handles the drawing onto the screen..

    when i ran the application and selected the option "XYZ" where i used
    ActivateLocalViewL(KReceivedViewId); // to activate the view created

    the view displayed a new screen with a line drawn as i coded but it immediately panics with KERN-EXEC 3.. i cant find where i went wrong..

    can anyone help me with wht is going wrong?? or is there anyway i can implement this other than the using views??


    Thanku
    Deepthi.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: series60 cameraApp

    just put break points in your code and run it line-by-line in the emulator to find out which line is giving this error. Anyway it is invalid pointer usage, either NULL pointer, or pointer that has non-NULL but invalid value.

    So check that all pointer are assigned before using them, and also remember to assign all pointer to NULL after deleting them.

    yucca

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: series60 cameraApp

    hi symbianyucca,
    i have inserted breakpoints n noticed that i was having problem after the DoActivateL(). After executing everything written is DoActivateL(), i think there is some problem in returning back to the place where ActivateLocalViewL() is being called.

    anyway have alook at the code:
    i have added classes 'CCameraAppRecView' derived from CAknView and
    'CCameraAppRecContainer' derived from CCoeControl...

    CCameraAppRecView.h:
    class CCameraAppRecView : public CAknView
    {
    public: // Constructors and destructor
    static CCameraAppRecView* NewL();
    static CCameraAppRecView* NewLC();
    ~CCameraAppRecView();
    private:
    void ConstructL();
    CCameraAppRecView();

    public: // Functions from base classes
    TUid Id() const;
    void HandleCommandL(TInt aCommand);
    void HandleClientRectChange();
    //void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
    public:
    void DoActivateL(const TVwsViewId&,TUid ,const TDesC8& );
    void DoDeactivate();
    private: // Data
    CCameraAppRecContainer* irecContainer;
    };

    CCameraAppRecView.cpp:
    #include "CameraAppRecView.h"
    #include "CameraAppController.h"
    #include "CameraAppRecContainer.h"
    #include <CameraApp.rsg>
    #include <eikmenub.h> //CEikMenuBar

    void CCameraAppRecView::ConstructL()
    {
    BaseConstructL( R_CAMERAAPP_VIEW3 );
    }

    CCameraAppRecView* CCameraAppRecView::NewL( )
    {
    CCameraAppRecView* self = CCameraAppRecView::NewLC();
    CleanupStack::Pop( self );
    return self;
    }

    CCameraAppRecView* CCameraAppRecView::NewLC()
    {
    CCameraAppRecView* self = new( ELeave ) CCameraAppRecView();
    CleanupStack::PushL( self );
    self->ConstructL();
    return self;
    }

    CCameraAppRecView::CCameraAppRecView() {}

    CCameraAppRecView::~CCameraAppRecView() {}

    TUid CCameraAppRecView::Id() const {
    return TUid::Uid(ERecViewId); }

    void CCameraAppRecView::HandleCommandL(TInt aCommand) {
    AppUi()->HandleCommandL( aCommand ); }

    void CCameraAppRecView::HandleClientRectChange()
    {
    if ( irecContainer ){
    irecContainer->SetRect( ClientRect() ); }
    }

    void CCameraAppRecView:oActivateL(const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,const TDesC8&)
    {
    ASSERT(!(irecContainer));
    irecContainer = CCameraAppRecContainer::NewL(ClientRect());
    CEikonEnv::Static()->AlertWin(_L("OK"),_L("Till here"));
    // when i activate the view from appui handlecommand i am able to get a blue screen with the above msg, when i press OK for this msg after that it panics with KERN-EXEC 3 error..
    }

    void CCameraAppRecView:oDeactivate()
    {
    if ( irecContainer ){
    AppUi()->RemoveFromStack(irecContainer );
    delete irecContainer;
    irecContainer = NULL;}
    }


    CCameraAppRecContainer.h:
    class CCameraAppRecContainer : public CCoeControl
    {
    public: // Constructors and destructor
    static CCameraAppRecContainer* NewL(const TRect& aRect);
    static CCameraAppRecContainer* NewLC(const TRect& aRect);
    ~CCameraAppRecContainer();
    void ConstructL(const TRect& aRect);
    public:
    void Draw(const TRect& /*aRect*/) const;
    };


    CCameraAppRecContainer.cpp:
    CCameraAppRecContainer* CCameraAppRecContainer::NewL(const TRect& aRect)
    {
    CCameraAppRecContainer* self = CameraAppRecContainer::NewLC(aRect);
    CleanupStack::Pop(self);
    return self;
    }

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

    CCameraAppRecContainer::~CCameraAppRecContainer() {}

    void CCameraAppRecContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    SetRect(aRect);
    ActivateL();
    }
    // Here i am jus displaying a blue screen
    void CCameraAppRecContainer:raw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbBlue);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
    }

    In the AppUI's HandleCommandL() i have
    case EXYZcmd:
    ActivateLocalViewL(TUid::Uid(ERecViewId));

    this is all the code i have inserted.. plsss lemme know where i went wrong..

    Thanku
    Deepthi.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: series60 cameraApp

    hey one more thing.. when i set this view as the default view in the AppUi's ConstructL() everything is fine.. i.e

    void CCameraAppAppUi::ConstructL()
    {
    ...
    ...
    CCameraAppRecView* view3 = CCameraAppRecView::NewL();
    AddViewL( view3 );

    SetDefaultViewL(*view3);
    ...
    }

    the problem occurs when i activate this view in the HandleCommandL()..
    have no idea abt this.. plz help..

    Thanks
    Deepthi.

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: series60 cameraApp

    plz lemme know if the code can be written that way.. or anything that i need to add..

Similar Threads

  1. RNotifier partially disabled on Series60?
    By mapeters in forum Symbian
    Replies: 0
    Last Post: 2004-10-07, 23:30
  2. Replies: 0
    Last Post: 2004-05-26, 15:11
  3. question about series40 & series60
    By justixx in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-02-19, 07:25
  4. miscellaneous series60 questions
    By dcanzeri in forum Symbian
    Replies: 0
    Last Post: 2003-05-04, 05:51
  5. Any working sample of BIOControl for Series60 ?
    By susanto_waluyo in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2002-08-02, 12:14

Posting Permissions

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