sbsv1/buildsystem/test/binaryvariation/InvariantStaticDLL.cpp
changeset 620 ad8ffc8e1982
parent 599 fa7a3cc6effd
equal deleted inserted replaced
585:238f4cb8391f 620:ad8ffc8e1982
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This program creates a dll.
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "InvariantStaticDLL.h"
       
    19 #include <e32uid.h>
       
    20 
       
    21 // construct/destruct
       
    22 
       
    23 EXPORT_C CInvMessenger* CInvMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString)
       
    24 	{
       
    25 	CInvMessenger* self=new (ELeave) CInvMessenger(aConsole);
       
    26 	CleanupStack::PushL(self);
       
    27 	self->ConstructL(aString);
       
    28 	return self;
       
    29 	}
       
    30 
       
    31 CInvMessenger::~CInvMessenger() // destruct - virtual, so no export
       
    32 	{
       
    33 	delete iString;
       
    34 	}
       
    35 
       
    36 // useful functions
       
    37 
       
    38 EXPORT_C void CInvMessenger::ShowMessage()
       
    39 	{
       
    40 	_LIT(KFormat1,"FEATURE INVARIANT %S\n");
       
    41 	iConsole.Printf(KFormat1, iString); // notify completion
       
    42 	}
       
    43 
       
    44 // constructor support
       
    45 // don't export these, because used only by functions in this DLL, eg our NewLC()
       
    46 
       
    47 CInvMessenger::CInvMessenger(CConsoleBase& aConsole) // first-phase C++ constructor
       
    48 	: iConsole(aConsole)
       
    49 	{
       
    50 	}
       
    51 
       
    52 void CInvMessenger::ConstructL(const TDesC& aString) // second-phase constructor
       
    53 	{
       
    54 	iString=aString.AllocL(); // copy given string into own descriptor
       
    55     }
       
    56 
       
    57 
       
    58 GLDEF_C TInt E32Dll(TInt /*aReason*/)
       
    59 // DLL entry point
       
    60 	{
       
    61 	return(KErrNone);
       
    62 	}