examples/AppFramework/Apparc/ServerApplication/harness/main.cpp

00001 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // main_serv_app.cpp
00015 //
00016 
00017 #include <e32base.h>
00018 
00019 #include "client_api.h"
00020 #include "session.h"
00021 
00022 const TUid KAppUid = { 0xE1111556 };
00023 
00024 static void callExampleL();
00025 
00026 extern TInt  E32Main()
00027     {
00028         __UHEAP_MARK;
00029         CTrapCleanup* cleanup=CTrapCleanup::New();
00030 
00031         TRAPD(error,callExampleL());
00032         _LIT(KTxtTrainingTest,"TrainingApp");   
00033         __ASSERT_ALWAYS(!error,User::Panic(KTxtTrainingTest,error));
00034         delete cleanup;
00035         __UHEAP_MARKEND; // Check the test program doesn't leak memory.
00036         return KErrNone;
00037         }
00038         
00039 static void callExampleL()
00040     {
00041     RServAppService exampleSess;
00042     
00043     _LIT(KHelloWorld,"Hello World!");
00044     
00045     TBufC<12> exampleBuf(KHelloWorld);
00046     
00047         exampleSess.ConnectNewAppL(KAppUid);
00048     exampleSess.Send(exampleBuf);
00049     exampleSess.Close();
00050     }

Generated by  doxygen 1.6.2