1 /* |
|
2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 #include "imageprintclientserver.h" |
|
22 #include "cimageprintserver.h" |
|
23 #include "cimageprintscheduler.h" |
|
24 #include "clog.h" |
|
25 |
|
26 // init and run the server |
|
27 static void RunTheServerL() |
|
28 { |
|
29 #ifndef __SECURE_API__ |
|
30 User::LeaveIfError( RThread().Rename( KImagePrintServerName ) ); //Deprecated! Replace this with the line below as soon as possible |
|
31 #else |
|
32 User::LeaveIfError( RThread().RenameMe( KImagePrintServerName ) ); |
|
33 #endif |
|
34 |
|
35 CActiveScheduler* scheduler = new (ELeave) CImagePrintScheduler; |
|
36 CleanupStack::PushL( scheduler ); |
|
37 CActiveScheduler::Install( scheduler ); |
|
38 |
|
39 CImagePrintServer::NewLC(); |
|
40 |
|
41 RProcess::Rendezvous( KErrNone ); |
|
42 |
|
43 CActiveScheduler::Start(); |
|
44 CleanupStack::PopAndDestroy( 2 ); // CImagePrintServer, scheduler |
|
45 } |
|
46 |
|
47 // Server process entry-point |
|
48 TInt E32Main() |
|
49 { |
|
50 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
51 TInt r( KErrNoMemory ); |
|
52 if( cleanup ) |
|
53 { |
|
54 TRAP( r, RunTheServerL() ); |
|
55 delete cleanup; |
|
56 } |
|
57 return r; |
|
58 } |
|
59 |
|
60 // End of File |
|