sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #include "t_oedll.h" sl@0: sl@0: // construct/destruct sl@0: sl@0: EXPORT_C CMessenger* CMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString) sl@0: { sl@0: CMessenger* self=new (ELeave) CMessenger(aConsole); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aString); sl@0: return self; sl@0: } sl@0: sl@0: CMessenger::~CMessenger() // destruct - virtual, so no export sl@0: { sl@0: delete iString; sl@0: } sl@0: sl@0: EXPORT_C void CMessenger::ShowMessage() sl@0: { sl@0: _LIT(KFormat1,"%S\n"); sl@0: iConsole.Printf(KFormat1, iString); // notify completion sl@0: } sl@0: sl@0: // constructor support sl@0: // don't export these, because used only by functions in this DLL, eg our NewLC() sl@0: sl@0: CMessenger::CMessenger(CConsoleBase& aConsole) // first-phase C++ constructor sl@0: : iConsole(aConsole) sl@0: { sl@0: } sl@0: sl@0: void CMessenger::ConstructL(const TDesC& aString) // second-phase constructor sl@0: { sl@0: iString=aString.AllocL(); // copy given string into own descriptor sl@0: } sl@0: sl@0: class MY_MY sl@0: { sl@0: public: sl@0: MY_MY(int aA){iA = aA;} sl@0: int iA; sl@0: int get() { return iA;} sl@0: }; sl@0: sl@0: class MY_TYPE sl@0: { sl@0: public: sl@0: MY_TYPE(MY_MY& aA){memcpy(&iA, &aA, sizeof(iA));} sl@0: int iA; sl@0: int get() { return iA;} sl@0: }; sl@0: sl@0: EXPORT_C int bar() sl@0: { sl@0: MY_MY amymy(0x1234); sl@0: static MY_TYPE mytype(amymy); sl@0: myfoo(); sl@0: return mytype.get(); sl@0: } sl@0: sl@0: extern "C" { sl@0: EXPORT_C int myfoo() sl@0: { sl@0: return 0x1234; sl@0: } sl@0: sl@0: }