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 .
[COLOR="Red"][SIZE="3"]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[/SIZE][/COLOR]
[CODE] _LIT(KThreadTicker,"TickerThread");
iThreadTicker.Create( KThreadTicker ,RunTicker, 4096, 1000, 5120,(void*)NULL,EOwnerProcess);[/CODE]
[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;
}
[/CODE]
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=SDK Help]typedef TInt[COLOR="Lime"](* TThreadFunction)[/COLOR](TAny*);[/QUOTE]The [COLOR="lime"]green(lime)[/COLOR] 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);[/CODE]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 ([url]http://discussion.forum.nokia.com/forum/member.php?u=113310[/url])