Symbian3/SDK/Source/GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66" xml:lang="en"><title>BIOMessageMgr:
BIO Message manager using the message server</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The BIO Message manager example comprises two projects <filepath>BIOMessage.exe</filepath> and <filepath>BIOParser.dll</filepath>.
The <filepath>BIOMessage.exe</filepath> example connects to the message server,
creates a BIO message and sends the registered parser DLL and message entry
to <filepath>BIOParser.dll</filepath>. </p>
<section id="GUID-BBF66472-C97E-5C14-85BB-30AD56703E83"><title>Download</title> <p>Click
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-34a2835d-797c-4d05-8919-03fc43821825.zip" scope="external">Biomsgexample.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-34a2835d-797c-4d05-8919-03fc43821825.html" scope="peer"> browse</xref> to view the example code. </p> </section>
<section id="GUID-3CD32BF4-F354-4281-9C9A-1FD5ED4761C7"><title>BIOMessage: BIO messaging using the message server</title> <p><b>Description</b> </p> <p>This
example code demonstrates BIO messaging using <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs</apiname></xref> and <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita"><apiname>RSendAsMessage</apiname></xref> and
other supporting classes as mentioned in the <xref href="GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66.dita#GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66/GUID-5048F691-DBA0-52DC-BBBA-922EE5DDE8D5">Class
Summary</xref> below. </p> <p>The <filepath>BIOMessage</filepath> example
code provides the following functionality: </p> <p><b>Creating a session </b> </p> <codeblock id="GUID-822DA39D-0568-54D9-A8EA-D49ABAB6D4D5" xml:space="preserve">void CBioMessage::Connect();</codeblock> <p>Creates
a session with the message server using <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs</apiname></xref>. </p> <p>The
generated console output looks like this: </p> <fig id="GUID-3F7EFDA7-7103-58F2-819B-F50A564F67F9">
<image href="GUID-13F10D4C-BA0C-5B46-804D-191A70C36324_d0e287313_href.png" placement="inline"/>
</fig> <p><b>Creating a BIO message </b> </p> <codeblock id="GUID-898B2AF1-6B24-516A-A8CF-CE210D9136EC" xml:space="preserve">void CBioMessage::Create(RSendAsMessage&amp; aMessage);</codeblock> <p>This function does the following: </p> <ul>
<li id="GUID-3B28353D-8885-56A2-9000-B2B481045A4A"><p>creates a BIO message
of VCard type </p> </li>
<li id="GUID-B8FE7FB1-D904-5520-9762-A0BAE0D53833"><p>sets the message body
text </p> </li>
<li id="GUID-AE681720-90EE-5AEE-9D98-54C41DD19E49"><p>adds the message recipients
for the message to be sent. </p> </li>
</ul> <p>The generated console output looks like this: </p> <fig id="GUID-7E3F4DA5-BFC3-5393-A04A-FDE944A89815">
<image href="GUID-7DDC1BC6-A100-5B50-ABFE-B4AA466716A6_d0e287350_href.png" placement="inline"/>
</fig> <p><b>Sending the BIO message </b> </p> <codeblock id="GUID-AA6C86D7-1657-5E3D-A025-43EB77FD3D31" xml:space="preserve">void CBioMessage::Send(RSendAsMessage&amp; aMessage);</codeblock> <p>Sends the message to the recipients. </p> <p>The generated console output
looks like this: </p> <fig id="GUID-75B51188-D5AA-5BBD-90CA-3C33D2CF3744">
<image href="GUID-3239641A-2D13-56D7-B18D-6E65B6B24886_d0e287369_href.png" placement="inline"/>
</fig> <p><b>Creating the parser </b> </p> <codeblock id="GUID-0E38D4C7-B9D8-5F6E-A0AB-315447101C1D" xml:space="preserve">CBioParser::NewL(CMsvEntry* aEntry);</codeblock> <p>Creates a <codeph>CBioParser</codeph> object based on the message entry. </p> <p><b>Parsing
the BIO message </b> </p> <codeblock id="GUID-BF605939-E297-5131-AFFA-DFED793492DF" xml:space="preserve">CBioParser::ParserL();</codeblock> <p>This
function does the following: </p> <ul>
<li id="GUID-A05F6576-7677-5D92-A9C4-1697D64CBAF3"><p>calls <codeph>ExtractMessageBodyL()</codeph> to
extract the message body text from <xref href="GUID-8CB90FA2-A6CF-3FA2-81FF-7D22EFD9C2CE.dita"><apiname>CMsvStore</apiname></xref>, the message
store </p> </li>
<li id="GUID-ADAB322E-2354-52C5-9B7C-A4335E84B6EF"><p>finds, loads and maintains
a reference count of client processes for a BIO parser DLL </p> </li>
<li id="GUID-5F5D6BE4-EECE-5E70-82C6-2EB92133A2AF"><p>parses the message body
text. </p> </li>
</ul> <p>The generated console output looks like this: </p> <fig id="GUID-2E3907F9-E810-5B1F-A6A0-60484FE004DF">
<image href="GUID-DCCA3BD3-582A-5C71-A104-D922FFE3C680_d0e287427_href.png" placement="inline"/>
</fig><p><b>Class Summary</b></p><p><xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs</apiname></xref></p><p> <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita"><apiname>RSendAsMessage</apiname></xref></p><p> <xref href="GUID-CB2BB982-F91D-3E06-8D66-56731AA60EB8.dita"><apiname>CSendAsMessageTypes</apiname></xref></p><p> <xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita"><apiname>CSendAsAccounts</apiname></xref></p><p> <xref href="GUID-49738A1E-D452-30F3-9044-6528CABBD5D4.dita"><apiname>CRegisteredParserDll</apiname></xref></p><p> <xref href="GUID-115327CD-43D1-324B-84D7-8DFB6226C42A.dita"><apiname>CBIODatabase</apiname></xref></p><p> <xref href="GUID-8CB90FA2-A6CF-3FA2-81FF-7D22EFD9C2CE.dita"><apiname>CMsvStore</apiname></xref></p> </section>
<section id="GUID-A61C8676-A44E-4F4B-96F3-D4836FD47370"><title>BIOParser: BIO message parsing</title> <p><b>Description</b> </p> <p>This
example code demonstrates the parsing of the message. <codeph>CBIOExampleParser</codeph> is
the wrapper class which uses <xref href="GUID-7A187B0D-79D6-3EAD-8181-FE2EBB9043DC.dita"><apiname>CBaseScriptParser2</apiname></xref> and other
supporting classes mentioned in the <xref href="GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66.dita#GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66/GUID-E9472DA3-DA7B-5F4B-ACBF-770D3DE81580">Class
Summary</xref> below. </p> <p>The <filepath>BIOParser</filepath> example code
provides the following functionality: </p> <p><b>Creating the parser </b> </p> <codeblock id="GUID-C4ED1683-524A-55DA-88CB-D321C2AA59C2" xml:space="preserve">CBIOExampleParser* CBIOExampleParser::NewL(CRegisteredParserDll&amp; aRegisteredParserDll, CMsvEntry&amp; aEntry, RFs&amp; aFs);</codeblock> <p>Creates a <codeph>CBIOExampleParser</codeph> object based on the registered
parser DLL and the message entry. </p> <p><b>Parsing the BIO message </b> </p> <codeblock id="GUID-6F493EBE-BD8C-5982-B1AB-B592A3BAD1F4" xml:space="preserve">void CBIOExampleParser::ParseL();</codeblock> <p>Parses
the BIO message. </p> <p><b>Processing the BIO message </b> </p> <codeblock id="GUID-106E21B6-CDFE-51AB-9C91-C263033B60AE" xml:space="preserve">CBIOExampleParser::ProcessL();</codeblock> <p>Processes
the parsed data. </p> <p id="GUID-E9472DA3-DA7B-5F4B-ACBF-770D3DE81580"><b>Class
Summary</b> </p><p><xref href="GUID-7A187B0D-79D6-3EAD-8181-FE2EBB9043DC.dita"><apiname>CBaseScriptParser2</apiname></xref></p> </section>
<section id="GUID-15A5B370-1546-4A27-8F3D-8BE336AE32FD"><title>Build</title> <p>The <filepath>BIOMessageMgr</filepath> example
code includes the following project files for building the application: <filepath>BIOParser.mmp</filepath>, <filepath>BIOMessage.mmp</filepath> and <filepath>bld.inf</filepath>. </p> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian
build process</xref> describes how to build this application. </p> <p>In CodeWarrior:
firstly, 'make' the <filepath>BIOParser.mcp</filepath> which creates <filepath>BIOParser.dll</filepath> and <filepath>BIOParser.lib</filepath> in <filepath>\epoc32\release\winscw\</filepath>  <i>&lt;build_variant&gt;</i>, then secondly,
make <filepath>BIOMessage.exe</filepath> in the same directory. Run <filepath>BIOMessage.mcp</filepath>,
which runs <filepath>BIOMessage.exe</filepath> thus launching the emulator. </p> </section>
<section id="GUID-E5C238CE-1321-4F18-9E37-C2CFE6D3995E"><title>Usage</title> <p>Launch the target. For emulator targets,
run: <filepath>\epoc32\release\&lt;wins or winscw&gt;\&lt;urel or           udeb&gt;\BIOMessage.exe</filepath>.
If TechView emulator is used, to run the application go to System menu and
click on Open files / programs window. Start the "BIO Messaging Example" application. </p> <p>Step
through each phase of the example by pressing the space bar or by tapping
on the window drawn by the example. </p> </section>
</conbody></concept>