00001 // Copyright (c) 2000-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 // Statically linked dll example 00015 // 00016 00017 00018 #include <e32cons.h> 00019 00020 00021 class CMessenger : public CBase 00022 { 00023 public: 00024 // Construction 00025 IMPORT_C static CMessenger* NewLC(CConsoleBase& aConsole, const TDesC& aString); 00026 // Destructor - virtual and class not intended 00027 // for derivation, so not exported 00028 ~CMessenger(); 00029 // general functions - exported 00030 IMPORT_C void ShowMessage(); 00031 private: 00032 // C++ constructor - not exported; 00033 // implicitly called from NewLC() 00034 CMessenger(CConsoleBase& aConsole); 00035 // 2nd phase construction, called by NewLC() 00036 void ConstructL(const TDesC& aString); // second-phase constructor 00037 private: 00038 CConsoleBase& iConsole; // Use the console (but not owned) 00039 HBufC* iString; // Allocated container for string data (destructor destroys) 00040 };