Advertisement

05.02.2003 at 09:32PM PDT, ID: 20604386
[x]
Attachment Details

RThread

Asked by liuhoihing in EPOC / Symbian Programming

Tags: rthread, example

Hello Experts,

   I have problem in starting a thread within my application. From my knowledge, to start a thread, i call the below coding:

// thread function
   class MyClass : public CActive
   {
     ...
     static TInt ThreadFunc(TAny* aNone);
   }
   
   TInt MyClass::ThreadFunc(TAny* aNone)
   {
     MyClass* pthis = (MyClass*)aNone;
     pthis->iConsole.Printf(_L("TEST")); // print a "test" on the screen
                                         // iConsole is the member function of MyClass
     return KErrNone;
   }

   void MyClass::ConstructL()
   { ...

// create the thread

     RThread mythread;
     _LIT(KThreadName, "My Thread");
     const KHepaSize = 0x800;
     TInt result = mythread.Create(KThreadName, (TThreadFunction)ThreadFunc, KDefaultStackSize,
                     KMinHeapSize, KMinHeapSize, KHeapSize, this, EOwnerThread);

     User::LeaveIfError(result);

// start the thread

    mythread.SetPriority(EPriorityMuchMore);
    mythread.Resume(); // Run the thread    

 ...
   }

  So, it compile without errors, but it appear that the thread (or thread function) doesn't run (coz no any print out in my screen). What wrong with my coding ? Is there any example code related to RThread ? How can i get more information of RThread ? Thx a lot.

Best regards,
hingStart Free Trial
[+][-]06.26.2003 at 01:53AM PDT, ID: 8804093

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: EPOC / Symbian Programming
Tags: rthread, example
Sign Up Now!
Solution Provided By: bsrujan
Participating Experts: 1
Solution Grade: A
 
 
[+][-]11.28.2003 at 02:27PM PST, ID: 9840166

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.15.2004 at 05:09AM PDT, ID: 11075124

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.19.2004 at 06:43PM PDT, ID: 11113669

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32