WEB开发网
开发学院手机开发Symbian 开发 Symbian 活动规划器 CActiveScheduler 的灵活应用... 阅读

Symbian 活动规划器 CActiveScheduler 的灵活应用

 2010-03-26 21:23:00 来源:WEB开发网   
核心提示:// the active scheduler to panic.TInt RunError(TInt aError);public:enum TNewClassTestState{EUninitialized=12, // UninitializedEInitialized=22, // InitalizedEErr

// the active scheduler to panic.

TInt RunError(TInt aError);

public:

enum TNewClassTestState

{

EUninitialized=12, // Uninitialized

EInitialized=22, // Initalized

EError=32 // Error condition

};

private:

TInt iState; // State of the active object

RTimer iTimer; // Provides async timing service

};

#endif // NEWCLASSTEST_H

/* ============================================================================

Name : NewClassTest.cpp Author : Alex Version : 1.0 Copyright : su-fun Description : CNewClassTest implementation ============================================================================ */

#include "NewClassTest.h"

CNewClassTest::CNewClassTest() : CActive(EPriorityStandard) // Standard priority

{

}

CNewClassTest* CNewClassTest::NewLC()

{

CNewClassTest* self = new ( ELeave ) CNewClassTest();

CleanupStack::PushL(self);

self->ConstructL(); return self;

}

CNewClassTest* CNewClassTest::NewL()

{

CNewClassTest* self = CNewClassTest::NewLC();

CleanupStack::Pop(); // self;

return self;

}

void CNewClassTest::ConstructL()

{

User::LeaveIfError(iTimer.CreateLocal() ); // Initialize timer

CActiveScheduler::Add( this); // Add to scheduler

}

CNewClassTest::~CNewClassTest()

{

Cancel(); // Cancel any request, if outstanding

iTimer.Close(); // Destroy the RTimer object

// Delete instance variables if any

}

void CNewClassTest::DoCancel()

{

iTimer.Cancel();

}

void CNewClassTest::StartL(TInt aState, TTimeIntervalMicroSeconds32

上一页  1 2 3 4 5 6  下一页

Tags:Symbian 活动 规划

编辑录入:coldstar [复制链接] [打 印]
赞助商链接