×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2007
    Location
    Spain
    Posts
    15

    Illegal access when using CAknSettingItemList derived object from CAknView

    I'm having illegal access errors when I try to use a ponter from my CAknSettingItemList derived object from my CAknView derived object in the DoActivateL method:

    Code:
    ----------------------------------------------------------------------------------------------------
    PGHome.h file:
    ----------------------------------------------------------------------------------------------------
    
    #include <aknsettingitemlist.h>
    #include "PGHomeSettings.h"
    
    class MEikCommandObserver;
    class PGHomeSettings;
    
    class CPGHome : CAknSettingItemList
    {
      ...
    }
    	
    ----------------------------------------------------------------------------------------------------
    PGHomeView.h file:
    ----------------------------------------------------------------------------------------------------
    
    #include <aknview.h>
    #include "PGHome.h"
    
    class CPGAppUi;
    
    class CPgHomeView : public CAknView {
    
    public:
    ...
    void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage );
    ...
    
    private:
    
    TPGHomeSettings* iSettings;
    CPGHome* iPGHome;
    
    }
    
    ----------------------------------------------------------------------------------------------------
    PGHomeView.cpp file:
    ----------------------------------------------------------------------------------------------------
    
    #include "PGHome.h"
    
    void CPGHomeView::DoActivateL( 
    		const TVwsViewId&,
    		TUid,
    		const TDesC8& )
    	{
    	SetupStatusPaneL();		
    	if ( iPGHome == NULL )
    	  {
    	    iSettings = TPGHomeSettings::NewL();
    
    	    iPGHome = new ( ELeave ) CPGHome( *iSettings, this );
    
    	    iPGHome->SetMopParent( this ); //illegal access from 'CPGHome' to protected/private member 'CCoeControl::SetMopParent(MObjectProvider *)'
    
    	    iPGHome->ConstructFromResourceL( R_PGHOME_PGHOME );//illegal access from 'CPGHome' to protected/private member 'CAknSettingItemList::ConstructFromResourceL(int)'
    
    	    iPGHome->ActivateL();//illegal access from 'CPGHome' to protected/private member 'CCoeControl::ActivateL()'
    
    	    iPGHome->LoadSettingValuesL();
    
    	    iPGHome->LoadSettingsL();//illegal access from 'CPGHome' to protected/private member 'CAknSettingItemList::LoadSettingsL()'
    
    	    AppUi()->AddToStackL( *this, iPGHome );//illegal access from 'CPGHome' to protected/private member 'CCoeControl::'
    
    	  } 
    	}
    
    ----------------------------------------------------------------------------------------------------
    I can't understand the problem since this code is the same than the one that's automatically generated when a UI Design is added to a project.

    Any help will be appreciated.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Illegal access when using CAknSettingItemList derived object from CAknView

    What is the exact error message?

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Spain
    Posts
    15

    Re: Illegal access when using CAknSettingItemList derived object from CAknView

    I'm sorry. I forgot to say that the error message is written as a commentary next to every line I get an error in the code I pasted.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Illegal access when using CAknSettingItemList derived object from CAknView

    Ah, I have not noticed the comments.
    Anyway, the error message contains the hint: those methods you are trying to access have suddenly become private/protected. Though normally most of them are public.
    Try
    Code:
    class CPGHome : public CAknSettingItemList
    as a first step.

Similar Threads

  1. Nokia 6101 Locked 2 TMobile Midlet can't access internet...
    By Jason Glass in forum Mobile Java Networking & Messaging & Security
    Replies: 45
    Last Post: 2007-11-14, 02:19
  2. Replies: 2
    Last Post: 2007-10-05, 20:40
  3. Replies: 0
    Last Post: 2006-12-26, 12:35
  4. Signal 5, access object atribute
    By netproyectos in forum Symbian
    Replies: 3
    Last Post: 2006-08-04, 23:06
  5. Why use direct screen access?
    By Kalderas in forum Symbian
    Replies: 3
    Last Post: 2003-10-10, 14:29

Posting Permissions

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