×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    47

    Question to obtain pointer or refence of a container in view class

    Hi All,
    How can i obtain the pointer or reference of a container in view class so that i can access the controls of container without creating one more instance of a container in view class.
    Plz help me through code.
    i'm new to this platform.
    Its urgent.

    Thanks in Adv.

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: to obtain pointer or refence of a container in view class

    well in the DoActivate function of your view class you can give container object as:

    ASSERT(!(iContainer2));
    iContainer2 = CMyContainer2::NewL(ClientRect());
    AppUi()->AddToStackL(*this,iContainer2);

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    47

    Question Re: to obtain pointer or refence of a container in view class

    Thanks Vineet,
    but what i'm trying is that from appui i've pass a item through view class instance and i've declared a function in view class.In that function i've taken instance of container class and passed a function which is public in container.
    so i want the pointer or reference of that container which is activated instead of creating an instance of container in the function.
    i can't directly use the container instance bcoz when that function is passed to container class it is not activating the control of activated control.
    here is the code in view.cpp:-

    void CMainPageView::Exchange(HBufC* aName)
    {

    CMainPage* iMainPage;
    iMainPage = CMainPage::NewL(ClientRect(), NULL, this);
    iMainPage->CategoryName(aName);
    }

    Here is the code in container.cpp:-

    void CMainPage::CategoryName(HBufC* aName)
    {
    //TRect edit1 = iEdit1->Rect();
    //CCoeControl* ctrl = Components().At(EEdit1).iControl;
    iEdit1->ActivateL();
    iEdit1->SetTextL(aName);
    iEdit1->DrawNow();
    }

    Plz help me.
    Its very urgent.

Similar Threads

  1. Switch view from container class
    By tamhanna in forum Symbian
    Replies: 3
    Last Post: 2009-02-04, 20:50
  2. External Linking Error (Undefined Symbol)
    By nile_mail in forum Symbian
    Replies: 2
    Last Post: 2008-08-05, 13:10
  3. Replies: 2
    Last Post: 2007-03-14, 17:15
  4. Replies: 1
    Last Post: 2003-03-26, 10:04
  5. CAknForm derived class does not display via navi pane
    By andyesquire in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-03-01, 19:07

Posting Permissions

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