sbsv2/raptor/test/smoke_suite/test_resources/bv/invariant/CreateStaticDLL_invariant.cpp
equal
deleted
inserted
replaced
|
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 * CreateStaticDLL.cpp |
|
16 * This program creates a dll. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #include "CreateStaticDLL_invariant.h" |
|
22 #include <e32uid.h> |
|
23 |
|
24 // construct/destruct |
|
25 |
|
26 EXPORT_C CMessenger* CMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString) |
|
27 { |
|
28 CMessenger* self=new (ELeave) CMessenger(aConsole); |
|
29 CleanupStack::PushL(self); |
|
30 self->ConstructL(aString); |
|
31 return self; |
|
32 } |
|
33 |
|
34 CMessenger::~CMessenger() // destruct - virtual, so no export |
|
35 { |
|
36 delete iString; |
|
37 } |
|
38 |
|
39 EXPORT_C void CMessenger::ShowMessage() |
|
40 { |
|
41 _LIT(KFormat1,"%S\n"); |
|
42 iConsole.Printf(KFormat1, iString); // notify completion |
|
43 } |
|
44 |
|
45 // constructor support |
|
46 // don't export these, because used only by functions in this DLL, eg our NewLC() |
|
47 |
|
48 CMessenger::CMessenger(CConsoleBase& aConsole) // first-phase C++ constructor |
|
49 : iConsole(aConsole) |
|
50 { |
|
51 } |
|
52 |
|
53 void CMessenger::ConstructL(const TDesC& aString) // second-phase constructor |
|
54 { |
|
55 iString=aString.AllocL(); // copy given string into own descriptor |
|
56 } |