author | Richard Taylor <richard.i.taylor@nokia.com> |
Wed, 14 Jul 2010 14:50:01 +0100 | |
changeset 616 | 24e4ef208cca |
parent 591 | 22486c9c7b15 |
child 625 | a1925fb7753a |
permissions | -rw-r--r-- |
591 | 1 |
/* |
616
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
2 |
* Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies). |
591 | 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 |
||
616
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
27 |
#if !defined(__ARMCC_4__) |
591 | 28 |
extern "C" void __ARM_switch8(); |
29 |
||
30 |
void sbs_test() |
|
31 |
{ |
|
32 |
__ARM_switch8(); |
|
33 |
} |
|
616
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
34 |
#endif |
591 | 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 |