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