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 // This program creates a polymorphic interface DLL which 00015 // executable "UsingDLLs" dynamically links to. 00016 // 00017 00018 00019 #include "PolymorphicDLL2.h" 00020 #include <e32def.h> 00021 #include <e32uid.h> 00022 00023 00024 // Function to construct a CMessenger object. Note that this function 00025 // is exported at ordinal 1 and is not a member of any class. 00026 00027 EXPORT_C CMessenger* NewMessengerL() 00028 { 00029 return new (ELeave) CGermanMessenger; 00030 } 00031 00032 // Class member functions 00033 00034 // second-phase constructor 00035 void CGermanMessenger::ConstructL(CConsoleBase* aConsole, const TDesC& aName) 00036 { 00037 iConsole=aConsole; // remember console 00038 iName=aName.AllocL(); // copy given string into own descriptor 00039 } 00040 00041 // destructor 00042 CGermanMessenger::~CGermanMessenger() 00043 { 00044 delete iName; 00045 } 00046 00047 // show message 00048 void CGermanMessenger::ShowMessage() 00049 { 00050 _LIT(KFormat1,"Guten Tag, Ich heisse %S \n"); 00051 iConsole->Printf(KNullDesC); 00052 iConsole->Printf(KFormat1, iName); 00053 }