00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "TelephonyISVExamples.h"
00018 #include "CMainMenu.h"
00019
00023 void MainL(CConsoleBase& aConsole)
00024 {
00025 CMainMenu* menu = CMainMenu::NewLC(aConsole);
00026 menu->Start();
00027
00028
00029 CActiveScheduler::Start();
00030 CleanupStack::PopAndDestroy(menu);
00031 }
00032
00036 void ConsoleMainL()
00037 {
00038
00039 CConsoleBase* aConsole = Console::NewL(_L("Telephony ISV API Example"),
00040 TSize(KConsFullScreen,
00041 KConsFullScreen));
00042 CleanupStack::PushL(aConsole);
00043 CActiveScheduler* sched = new(ELeave) CActiveScheduler();
00044
00045
00046 CleanupStack::PushL(sched);
00047
00048
00049 CActiveScheduler::Install(sched);
00050
00051
00052 MainL(*aConsole);
00053
00054 aConsole->Printf(_L("[ Press any key to end ]"));
00055 aConsole->Getch();
00056
00057
00058 CleanupStack::PopAndDestroy(sched);
00059 CleanupStack::PopAndDestroy(aConsole);
00060 }
00061
00065 GLDEF_C TInt E32Main()
00066 {
00067 __UHEAP_MARK;
00068 CTrapCleanup* cleanupStack = CTrapCleanup::New();
00069 TRAPD(error, ConsoleMainL());
00070 __ASSERT_ALWAYS(!error, User::Panic(_L("Console main error\n"), error));
00071 delete cleanupStack;
00072 __UHEAP_MARKEND;
00073 return KErrNone;
00074 }
00075