Symbian一个活动对象的测试例子
2010-10-20 08:00:45 来源:WEB开发网// takes care of command handling
// ----------------------------------------------------
//
void CActiveTest2AppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyBack:
case EEikCmdExit:
{
Exit();
break;
}
case EActiveTest2CmdAppTest:
{
// Info message shown only in the emulator
//iEikonEnv->InfoMsg(_L("test"));
//Load localized message from the resource file
//HBufC* message = CEikonEnv::Static()->AllocReadResourceLC(R_MESSAGE_TEXT);
// Show information note dialog
//CAknInformationNote* note = new (ELeave) CAknInformationNote;
//note->ExecuteLD(message->Des());
//CleanupStack::PopAndDestroy(message);
iTest2NewClass->StartL(3000000);
break;
}
// TODO: Add Your command handling code here
default:
break;
}
}
ActiveTest2NewClass.h
/*
============================================================================
Name : ActiveTest2NewClass.h
Author :
Version :
Copyright : Your copyright notice
Description : CActiveTest2NewClass declaration
============================================================================
*/
#ifndef ACTIVETEST2NEWCLASS_H
#define ACTIVETEST2NEWCLASS_H
#include // For CActive, link against: euser.lib
#include // For RTimer, link against: euser.lib
class CActiveTest2NewClass : public CActive
{
public:
// C++ constructor
CActiveTest2NewClass();
// Second-phase constructor
void ConstructL();
// Cancel and destroy
更多精彩
赞助商链接