Symbian一个活动对象的测试例子
2010-10-20 08:00:45 来源:WEB开发网今天闲来无事写了一个活动对象的测试代码,谁知道一运行死活跑不起来.程序执行到SetActive()就自动退出.硬是把这个简单的例子搞了2个小时. 后来才知道原来Carbide.vs提供的Active框架没有重写NewL()或者NewLC()方法,而我直接调用new (ELeave) CActiveTest2NewClass;并没有初始化ConstructL()里面的数据.编译也不报错,Debug跟踪却是下面一行出问题.郁闷的要命.
下面的代码就是今天的收获:
CActiveTest2AppUi from ActiveTest2Appui.h
/*
============================================================================
Name : CActiveTest2AppUi from ActiveTest2Appui.h
Author :
Version :
Copyright : Your copyright notice
Description : Declares UI class for application.
============================================================================
*/
#ifndef ACTIVETEST2APPUI_H
#define ACTIVETEST2APPUI_H
// INCLUDES
#include
// FORWARD DECLARATIONS
class CActiveTest2Container;
class CActiveTest2NewClass;
// CLASS DECLARATION
/**
* Application UI class.
* Provides support for the following features:
* - EIKON control architecture
*
*/
class CActiveTest2AppUi : public CAknAppUi
{
public: // // Constructors and destructor
/**
* EPOC default constructor.
*/
void ConstructL();
/**
* Destructor.
*/
~CActiveTest2AppUi();
public: // New functions
public: // Functions from base classes
private:
// From MEikMenuObserver
void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
private:
/**
* From CEikAppUi, takes care of command handling.
* @param aCommand command to be handled
更多精彩
赞助商链接