// GetIMEI.h // // Copyright (c) 2000-2002 Symbian Ltd. All rights reserved. #ifndef __GETIMEI_H #define __GETIMEI_H #include #include _LIT(KTxtEPOC32EX,"EPOC32EX"); _LIT(KTxtExampleCode,"Symbian Example Code"); _LIT(KFormatFailed,"FAILED: leave code = %d"); _LIT(KTxtOK,"OK"); _LIT(KTxtPressAnyKey," [Press any key to continue]"); // public class RTelServer; LOCAL_D CConsoleBase* console; // Screen output LOCAL_C void doExampleL(); // Main function LOCAL_C const TDesC& GetIMEINumberL(RTelServer& aTelServer, TInt aPhoneId); // Return IMEI for given phone // private LOCAL_C void callExampleL(); // Initialize cleanup stack, etc. then call doExampleL() GLDEF_C TInt E32Main() // Main function called by E32 { __UHEAP_MARK; CTrapCleanup* cleanup=CTrapCleanup::New(); TRAPD(error,callExampleL()); // Does more initialization, then calls doExampleL() __ASSERT_ALWAYS(!error,User::Panic(KTxtEPOC32EX,error)); delete cleanup; __UHEAP_MARKEND; return 0; } LOCAL_C void callExampleL() // Initialize and call example code under cleanup stack { console=Console::NewL(KTxtExampleCode,TSize(KConsFullScreen,KConsFullScreen)); CleanupStack::PushL(console); TRAPD(error,doExampleL()); // Perform example function if (error) console->Printf(KFormatFailed, error); else console->Printf(KTxtOK); console->Printf(KTxtPressAnyKey); console->Getch(); // Get and ignore character CleanupStack::PopAndDestroy(); // Close console } #endif