os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraserver/src/mmcameraserverstartup.cpp
First public contribution.
1 // Copyright (c) 2008-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #include <ecom/ecom.h>
22 #include "mmcameraserver.h"
24 // Perform all server initialisation, in particular creation of the
25 // scheduler and server and then run the scheduler
26 static void RunServerL()
28 User::LeaveIfError(User::RenameProcess(KMMCameraServerName));
30 // create and install the active scheduler we need
31 CActiveScheduler* activeScheduler = new(ELeave) CActiveScheduler;
32 CleanupStack::PushL(activeScheduler);
33 CActiveScheduler::Install(activeScheduler);
35 // Create the server, leaving it on the cleanup stack.
36 CMMCameraServer::NewLC();
38 // Initialisation complete, now signal the client
39 RProcess::Rendezvous(KErrNone);
42 CActiveScheduler::Start();
44 // Cleanup the server and scheduler
45 CleanupStack::PopAndDestroy(2, activeScheduler);
49 * Program entry point.
50 * Symbian OS will call this method when the server process is started.
52 GLDEF_C TInt E32Main()
55 CTrapCleanup* cleanup = CTrapCleanup::New();
56 TInt err = KErrNoMemory;
60 TRAP(err,RunServerL());
64 REComSession::FinalClose();