00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __CommonFiles_H
00018 #define __CommonFiles_H
00019
00020 #include <e32cons.h>
00021
00022
00023 LOCAL_D CConsoleBase* console;
00024 LOCAL_C void doExampleL();
00025
00026
00027 LOCAL_C void callExampleL();
00028
00029 GLDEF_C TInt E32Main()
00030 {
00031 _LIT(KSymbianEx,"SymbianEx");
00032 CTrapCleanup* cleanup=CTrapCleanup::New();
00033 TRAPD(error,callExampleL());
00034 __ASSERT_ALWAYS(!error,User::Panic(KSymbianEx,error));
00035 delete cleanup;
00036 return 0;
00037 }
00038
00039 LOCAL_C void callExampleL()
00040 {
00041 _LIT(KStatus1,"Symbian platform Example Code (comms)");
00042 _LIT(KStatus2,"failed: leave code=%d");
00043 _LIT(KStatus3,"ok");
00044 _LIT(KStatus4," [press any key]");
00045
00046 console=Console::NewL(KStatus1,TSize(KConsFullScreen,KConsFullScreen));
00047
00048 CleanupStack::PushL(console);
00049 TRAPD(error,doExampleL());
00050 if (error) console->Printf(KStatus2, error);
00051 else console->Printf(KStatus3);
00052 console->Printf(KStatus4);
00053 console->Getch();
00054 CleanupStack::Pop();
00055 }
00056
00057 #endif