|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "starter.h" |
|
17 |
|
18 LOCAL_C void StartAppsL(); |
|
19 CActiveScheduler* TheScheduler; |
|
20 |
|
21 #if defined(__WINS__) |
|
22 // |
|
23 EXPORT_C TInt EntryPoint(TAny* /*aCmdLine*/) |
|
24 // |
|
25 #else |
|
26 // |
|
27 GLDEF_C TInt E32Main() |
|
28 #endif |
|
29 { |
|
30 |
|
31 __UHEAP_MARK; // mark heap state |
|
32 |
|
33 CTrapCleanup* TheTrapCleanup=CTrapCleanup::New(); |
|
34 TRAPD(error, StartAppsL()); |
|
35 delete TheTrapCleanup; |
|
36 |
|
37 __UHEAP_MARKEND; // check no memory leak |
|
38 |
|
39 return(error); |
|
40 } |
|
41 |
|
42 |
|
43 LOCAL_C void StartAppsL() |
|
44 { |
|
45 TheScheduler=new(ELeave) CActiveScheduler(); |
|
46 CleanupStack::PushL(TheScheduler); |
|
47 CActiveScheduler::Install(TheScheduler); |
|
48 |
|
49 CStarter *starter = CStarter::NewL(); |
|
50 CleanupStack::PushL(starter); |
|
51 |
|
52 CActiveScheduler::Add(starter); |
|
53 starter->Start(); |
|
54 CActiveScheduler::Start(); |
|
55 |
|
56 CleanupStack::PopAndDestroy(2); // starter,TheScheduler |
|
57 } |