WEB开发网
开发学院手机开发Symbian 开发 Symbian一个活动对象的测试例子 阅读

Symbian一个活动对象的测试例子

 2010-10-20 08:00:45 来源:WEB开发网   
核心提示:~CActiveTest2NewClass();public: // New functions// Function for making the initial requestvoid StartL(TTimeIntervalMicroSeconds32 aDelay);//就是下面两个方法Carbide.vs没提

~CActiveTest2NewClass();

public: // New functions

// Function for making the initial request

void StartL(TTimeIntervalMicroSeconds32 aDelay);

//就是下面两个方法Carbide.vs没提供

static CActiveTest2NewClass* NewLC();

static CActiveTest2NewClass* NewL();

private: // From CActive

// Handle completion

void RunL();

// How to cancel me

void DoCancel();

// Override to handle leaves from RunL(). Default implementation causes

// the active scheduler to panic.

//void RunError(TInt aError);

private:

enum TActiveTest2NewClassState

{

EUninitialized, // Uninitialized

EInitialized, // Initalized

EError // Error condition

};

private:

TInt iState; // State of the active object

RTimer iTimer; // Provides async timing service

TInt iCount;

};

#endif

ActiveTest2NewClass.cpp

/*

============================================================================

Name : ActiveTest2NewClass.cpp

Author :

Version :

Copyright : Your copyright notice

Description : CActiveTest2NewClass implementation

============================================================================

*/

#include "ActiveTest2NewClass.h"

#include

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

{

}

void CActiveTest2NewClass::ConstructL()

{

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

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

}

CActiveTest2NewClass* CActiveTest2NewClass::NewLC()

{

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

Tags:Symbian 一个 活动

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