Symbian3/SDK/Source/GUID-B79B6DD2-40C5-591B-AF56-5ACD167C66F5.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 15:24:26 +0000
changeset 2 ebc84c812384
parent 0 89d6a7a84779
permissions -rw-r--r--
week 10 bug fix submission: Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.

<?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-B79B6DD2-40C5-591B-AF56-5ACD167C66F5" xml:lang="en"><title>Installing
an MTM</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>This section explains how to install MTMs during build time to include
them in ROM and how to install MTMs at run time on to a target phone (not
in ROM). </p>
<section><title>Build time</title> <p>To install an MTM during build time,
complete the following steps: </p> <ol id="GUID-69A643BE-D84D-5799-AC9B-DE4909FC474A">
<li id="GUID-4D566FC3-1D68-52A6-B089-20D10FDD86E4"><p>Build the MTM DLLs to
a <filepath>\sys\bin</filepath> directory on any drive. For example, <filepath>c:\sys\bin</filepath>. </p> </li>
<li id="GUID-1FD3BE6E-75CB-52E9-9437-1F099DE63777"><p>Build the MTM resource
file to <filepath>resource\messaging\mtm</filepath>. </p><note> You can do
this manually or use the mmp file syntax to export it to the <filepath>\resource\messaging\mtm</filepath> directory
automatically at build time.</note> </li>
</ol> <p><b>Example</b> </p> <codeblock id="GUID-90D8E09C-7F3D-5D07-8056-083A0EAC1486" xml:space="preserve">// mtm.mmp

/**
@file

@SYMPurpose mtm.dll
*/

TARGET        mtm.dll
TARGETTYPE    dll
TARGETPATH    sys/bin

CAPABILITY    ReadDeviceData WriteDevicedata 
UID        0x1000008d 0x10204286
VENDORID    0x70000001

SOURCEPATH    ../src

USERINCLUDE     ../inc
SYSTEMINCLUDE    /epoc32/include 

LIBRARY        euser.lib 
LIBRARY        msgs.lib 
LIBRARY        bafl.lib 
LIBRARY        efsrv.lib 

SOURCEPATH    .
start resource mtm.rss
TARGET        mtm.rsc
TARGETPATH  resource/messaging/mtm
end

</codeblock> </section>
<section><title>Run time</title> <p>After creating a group of MTMs, you have
to write an MTM installation application to install and register the MTMs
with the Message Server using the <xref href="GUID-92D6CC11-C597-5D00-AAE5-866289B7462F.dita">MTM
resource file</xref>. A program to do this would typically be run at the end
of installation. </p> <p><b>Procedure</b> </p> <p>To install an MTM at run
time on to a target phone, complete the following steps: </p> <ol id="GUID-33B69DC3-8A6B-585F-BE2F-F8484CACAC4C">
<li id="GUID-209A4F6B-05D8-5F3E-979B-B28153FD66F9"><p>Create a session with
the Message Server using the <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita"><apiname>CMsvSession</apiname></xref> class. </p> </li>
<li id="GUID-ECF08244-F9C6-582D-8A90-1387D627E5B8"><p>Call <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-E6553712-78CF-366C-B72A-5B673616C1A0"><apiname>CMsvSession::InstallMtmGroup()</apiname></xref> to
install a new group of MTMs. </p> <p> <b> Result:</b> The <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-E6553712-78CF-366C-B72A-5B673616C1A0"><apiname>CMsvSession::InstallMtmGroup()</apiname></xref> function
notifies the Message Server about the availability of a new MTM. When this
is done, all running client processes are also notified about the availability
of a new MTM. </p> <codeblock id="GUID-5CEEAD15-9165-5346-99B8-FB80240438E6" xml:space="preserve">// Creating a Message Server session
CDummyObserver ob;
iSession=CMsvSession::OpenSyncL(ob);
CleanupStack::PushL(iSession);
//Install an MTM using a resource file
iSession-&gt;InstallMtmGroup(ResourceFileName);</codeblock> </li>
</ol> <p>To remove an MTM, call the <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-808E9D5B-9F41-3450-B48C-3312E4296E8E"><apiname>CMsvSession::DeInstallMtmGroup()</apiname></xref> function. </p> <p> <b>Result:</b> The <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-808E9D5B-9F41-3450-B48C-3312E4296E8E"><apiname>CMsvSession::DeInstallMtmGroup()</apiname></xref> function dynamically notifies the running client processes about the non-availability
of the MTM. </p><note> The <xref href="GUID-C8FBC95B-223A-31E5-8D4C-D45B61BD078F.dita"><apiname>InstallMtmGroup()</apiname></xref> and <xref href="GUID-D32B5980-3046-31D7-A516-5556B4FED834.dita"><apiname>DeInstallMtmGroup()</apiname></xref> functions
must be used only by an MTM installation application.</note> </section>
<section><title>See also</title> <p><xref href="GUID-92D6CC11-C597-5D00-AAE5-866289B7462F.dita">MTM
Resource File</xref>  </p> </section>
</conbody></concept>