×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    235

    Question Multiple markers at this line with RThread

    I am trying to create an RThread object in my AppUi but my compiler is giving me the following error message . Please help .

    Multiple Markers at ths line
    '-RThread::Create(const TDesC16 & ,(int*)(void*),int,int,int,void*,
    TOwnerType)non static
    -RThread::Create(const TDesC16 & ,(int*)(void*),int,RHeap*,void*,
    TOwnerType)non static
    -RThread::Create(const TDesC16 & ,(int*)(void*),int,void*,RLibrary*,RHeap*,int,int,
    TOwnerType)non static
    -function call [RThread].Create({lval} const TLitC< 13 >,(int*)(void*)(CAknExGridAppUi::*)(),int,int,int,void*,
    TOwnerType)' does not match


    Code:
     _LIT(KThreadTicker,"TickerThread");
    iThreadTicker.Create( KThreadTicker ,RunTicker, 4096, 1000, 5120,(void*)NULL,EOwnerProcess);
    Code:
    TThreadFunction CAknExGridAppUi::RunTicker()
    {
    // mark the heap start
      __UHEAP_MARK;
      // create the obligatory cleanup stack
    	  CTrapCleanup* cleanup=CTrapCleanup::New();
    	  // execute the init console function, trapped
    	  TRAPD(error,
    
    if(iDrawer0==NULL)
    	  {iDrawer0 =new (ELeave) CDrawer();
    	  	iDrawer0->SetMopParent(this);
    			 iDrawer0->ConstructL( TRect(TPoint(0,0), TSize(ClientRect().Width(),16))
    			       		   			,0 ,KRgbDarkBlue,KRgbWhite,1);
    			 iDrawer0->MakeVisible(ETrue);
    			       		   
    	   }
    			       		   	
    if(iDrawer1==NULL)
    	    {
    		iDrawer1 =new (ELeave) CDrawer();
    		iDrawer1->SetMopParent( this );
    		iDrawer1->ConstructL(  TRect(TPoint(0,0), TSize(ClientRect().Width(),16))
    			       		   			,1,KRgbWhite, KRgbDarkBlue,1);
    		}
    	   iDrawer1->MakeVisible(ETrue);
    	   )
    
    	   // no error or panic
    	  	  __ASSERT_ALWAYS(!error,User::Panic(_L("Error in thread"),error));
    	  	  // clean the cleanup stack
    	  	  delete cleanup;
    	  	  // mark the end
    	  	   __UHEAP_MARKEND;
    
    	        return NULL;
    
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,566

    Re: Multiple markers at this line with RThread

    Consider re-reading what TThreadFunction is. It is not a return type, it defines how the thread function should look like.
    Quote Originally Posted by SDK Help
    typedef TInt(* TThreadFunction)(TAny*);
    The green(lime) part shows that it is a function pointer, imagine RunTicker there (replacing the full string), and remove the typedef:
    Code:
    static TInt RunTicker(TAny *aAny);
    should appear in the header file (note the static: thread can not run "inside" an object, it has to be a global function)
    - so the "this" references will not work
    - unfortunately the whole concept will not work, since accessing the GUI part of your application directly from a secondary thread is not possible, CONE is designed to be used from a single thread.

    What do you need exactly? Remember the signature of Paul Todd (http://discussion.forum.nokia.com/fo...r.php?u=113310)

Similar Threads

  1. i cant build helloworld project
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2008-12-22, 12:38
  2. ERROR IN CREATING THEME
    By ssmantri in forum Themes/Carbide.ui
    Replies: 5
    Last Post: 2008-05-29, 20:58
  3. Error while making sis file
    By lalitjadiya in forum Symbian C++
    Replies: 9
    Last Post: 2008-05-20, 17:18
  4. carbidec++ helloworld project problem
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 0
    Last Post: 2007-03-11, 12:40
  5. carbide build problem help please
    By berkcekisbas in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-09-26, 19:41

Posting Permissions

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