⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commonframework.h

📁 《基于symbian os的手机开发与应用》
💻 H
字号:
//
// Copyright (c) 2005 NEUSOFT Institute of inforamtion technology ChenDu.
// All rights reserved.
//
// CommonFramework.h
// the common framework for all the program
//
// Version 1.0
// by YangZongde
// 2005-9-28

#ifndef __CommonFramework_H				//compile pretreatment
#define __CommonFramework_H

#include <e32base.h>					//inclde the base library
#include <e32cons.h>
_LIT(KTxtEPOC32EX,"EXAMPLE");
_LIT(KTxtExampleCode, "EXAMPLE");
_LIT(KFormatFailed,"failed:leave code=%d");
_LIT(KTxtOK,"OK");
_LIT(KTxtPressAnyKey,"[press any key]");

//public
LOCAL_D CConsoleBase* console;				//declare the variable
LOCAL_C void doExampleL();				//declare the function

//private
LOCAL_C void callExampleL();

GLDEF_C TInt E32Main()					//the entry of program
{
	__UHEAP_MARK;					//heap check beginner
	CTrapCleanup* cleanup=CTrapCleanup::New();	//the cleanup
	TRAPD(error,callExampleL());			//trap if error
	__ASSERT_ALWAYS(!error,User::Panic(KTxtEPOC32EX,error));	//if error=1 ,invoke the panic
	delete cleanup;					//delete 
	__UHEAP_MARKEND;				//heap checkend,if error,invoke the panic
	return 0;
}

LOCAL_C void callExampleL()
{
	console=Console::NewL(KTxtExampleCode,TSize(KConsFullScreen,KConsFullScreen));
	CleanupStack::PushL(console);			//pushl the pointer to stack
	TRAPD(error,doExampleL());			//trap if error
	if(error)
		console->Printf(KFormatFailed,error);
	else
		console->Printf(KTxtOK);
	console->Printf(KTxtPressAnyKey);
	console->Getch();				//wait user press any key
	CleanupStack::PopAndDestroy(console);		
}

#endif





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -