|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-3603126B-661E-509B-8CCF-04A99F9ACE07" xml:lang="en"><title>HelloWorld: |
|
13 writes “Hello World!” to the console</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section><title>Description</title> <p> <codeph>HelloWorld</codeph> is a very |
|
15 simple piece of code showing how text is written to the console. All other |
|
16 examples in <filepath>Basics</filepath> and <filepath>System</filepath> use |
|
17 the same technique. </p> <p>The file <filepath>CommonFramework.h</filepath> contains |
|
18 the entry point and all code necessary to support the example itself, including |
|
19 the construction of the console and the cleanup stack. Putting code into a <filepath>.h</filepath> file |
|
20 may not be conventional practice, but it is useful to do so here. </p> </section> |
|
21 <section><title>Download</title> <p>Click on the following link to download |
|
22 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-9a9bd0dd-017a-4460-b7d8-019616ebfa39.zip" scope="external">HelloWorld.zip</xref></p><p>Download some additional files |
|
23 required by the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-bd05bfa4-e51c-4cf7-b327-646b0b9e814d.zip" scope="external">CommonFramework.zip</xref>.</p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-9a9bd0dd-017a-4460-b7d8-019616ebfa39.html" scope="peer">browse</xref> to view the example code. </p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-bd05bfa4-e51c-4cf7-b327-646b0b9e814d.html" scope="peer">browse</xref> to view the additional file.</p> </section> |
|
24 <section><title>Build</title> <p>The example includes the two project files |
|
25 needed for building: <filepath>bld.inf</filepath> and the <filepath>.mmp</filepath> file. </p> <p><xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">The Symbian platform build |
|
26 process</xref> describes how to build this application, which results in an |
|
27 executable called: </p> <p> <filepath>\epoc32\release\<target>\<urel |
|
28 or udeb>\HELLOWORLD.EXE</filepath>. </p> </section> |
|
29 <section><title>Usage</title> <p>Run the executable <filepath>HELLOWORLD.EXE</filepath>. </p> <p>Executables |
|
30 for the emulator targets <filepath>wins</filepath> and <filepath>winscw</filepath> can |
|
31 be run on your PC. Executables for ARM targets must be copied to your target |
|
32 platform before being run. </p> </section> |
|
33 <section><title>Classes used</title> <p>The example shows the use of the <codeph>_LIT</codeph> macro |
|
34 which is used throughout all of the examples. The macro generates a: </p> <codeblock id="GUID-FD21D75C-AA23-5F83-9076-2F9CA6F313A8" xml:space="preserve">const static TLitC<TInt></codeblock> <p>object |
|
35 and is an efficient and convenient way of generating constant literal text. </p> <p>As |
|
36 this is a wide (Unicode) build, <codeph>TLItC<TInt></codeph> is a typedef |
|
37 for <codeph>TLitC16<TInt>.</codeph> </p> </section> |
|
38 </conbody></concept> |