diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-56841E07-1A4A-5572-BF3F-F80069FD5D59.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-56841E07-1A4A-5572-BF3F-F80069FD5D59.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,66 @@ + + + + + +How +to start active objectsThis document describes how to start active objects. +

The following example code shows how active objects are started. While +the example shows the creation of an active scheduler, in UI applications, +an active scheduler is always provided.

+ +LOCAL_C void doExampleL() + { + // Create and install the active scheduler + CActiveScheduler* exampleScheduler=new (ELeave) CExampleScheduler; + CleanupStack::PushL(exampleScheduler); + CActiveScheduler::Install(exampleScheduler); + + // Create the service provider. Often, the + // service provider is part of the active object + CExampleServiceProvider* myServiceProvider=new (ELeave) CExampleServiceProvider; + CleanupStack::PushL(myServiceProvider); + + // Create the active object and issue the + // first asynchronous request + CExampleActiveObject * myActiveObject=new (ELeave) CExampleActiveObject(myServiceProvider); + CleanupStack::PushL(myActiveObject); + myActiveObject->IssueRequest(); + + // Now we can start the active scheduler + CActiveScheduler::Start(); + + // Remove the exampleScheduler and other + // objects from cleanup stack and destroy them + CleanupStack::PopAndDestroy(3); + } +
\ No newline at end of file