×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    27

    How to get a pointer to my container class?

    Short Question:
    I want to manipulate my Container from within the AppUI class. So how to get a pointer to it?
    BTW: I'm using multiview architecture!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166
    in case you really need to do it in your appui, would you be better off not using the view architecture, but using the old container architecture.

    In view arcitecture your views know which container is on top, so with view architecture you might want to handle them completely in views.

    also with view architecture your appui knows which view is currently active and you could get it's pointer and use it to communicate with the view which then could comunicate the current container.

    yucca

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    27
    You wrote : "also with view architecture your appui knows which view is currently active and you could get it's pointer and use it to communicate with the view which then could comunicate the current container."

    So that's a good way? Then I want to do that, because the old I don't know how to use the old container architecture. But how can get the pointer of the view? Could someone give me a hint (although I will try it by myself today) please?

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

    Basically if you keep track on which view is active (for example keeping the UID value of last activated view stored in AppUi class variable) you could use View() in your Appui class to get the pointer to the view, then if you cast this pointer to your View class, you can use any public function of it from AppUi class.

    yucca

  5. #5
    Registered User
    Join Date
    Oct 2003
    Posts
    27
    Thank you so much!!!

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    Basically you can do it this way:

    in your AppUi

    ((CYourAppView1*)View(TUid::Uid(1)))->DoSomethingL();

    in your View (defined as a public method)

    void CYourAppView1::DoSomethingL()
    {
    if (iContainer)
    iContainer->DoSomethingL();
    }

    But as Yucca said, you need to know which view is active, coz if you call this view at the time when it is deactivated then it will of course crash down....

Posting Permissions

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