Symbian3/SDK/Source/GUID-641A276D-F618-50CE-BA5A-658DCC26BAB5.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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 task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-641A276D-F618-50CE-BA5A-658DCC26BAB5" xml:lang="en"><title>Creating
an Implementation Project File </title><abstract>An implementation project file is a .mmp file, which specifies the
essential elements of the implementation. The project files are used for project
development. The implementation project file contains information (source
file, build file) about the implementation that is being built.<shortdesc>The
format of implementation project file is dependent on the version of the Symbian
platform used. The differences basically reflect the introduction of platform
security into Symbian OS v9.0 and later versions. </shortdesc></abstract><prolog><metadata><keywords/></metadata></prolog><taskbody>
<steps-unordered id="GUID-C62C17ED-E41C-54FA-BA0A-9C10A49E159B">
<step id="GUID-BB98ED98-0E27-4865-857D-01BC54ACB226"><cmd>For creating a plug-in
project file for Symbian OS v9.1 and later: </cmd>
<substeps id="GUID-A24F641F-EF19-46A2-8B4B-883E726AE909">
<substep id="GUID-F4AC55A1-0B66-4F17-8B24-2BE518949884"><cmd/>
<info>Set <codeph>TARGET</codeph> to the standard DLL name. <codeph>TARGET</codeph> contains
the final binary name of the project generated. </info>
<info>The plug-in DLL file is stored along other binaries in the<filepath>\Sys\Bin</filepath> directory.
The plug-in framework does not discover plug-ins installed in the pre v9.1
location, <filepath>\System\Libs\Plugins</filepath>. </info>
</substep>
<substep id="GUID-3D73991A-AC41-428C-92B8-1B8C6CDD7419"><cmd/>
<info>Set <codeph>TARGETTYPE</codeph> to PLUGIN. <codeph>TARGETTYPE</codeph> specifies
the type of binary. </info>
<info>Set <codeph>TARGETTYPE</codeph> to PLUGIN3 for DLLs supporting the extension
interfaces. PLUGIN3 DLLs are given the UID2 value of 0x10009D93. </info>
</substep>
<substep id="GUID-9C78513D-ACDC-4C26-BFF0-74E6410212A8"><cmd/>
<info>Set <codeph>UID</codeph> to plug-in framework DLL recognition UID followed
by the unique UID of the plug-in. </info>
<info>UID of the plug-in must be the same as the one specified in the <codeph>dll_uid</codeph> member
in the <xref href="GUID-9A9103E4-27B0-5CF3-855A-DCD44795A5C0.dita">registration
resource file</xref>. </info>
</substep>
<substep id="GUID-52CCD76E-8FCA-45F1-89BC-5EF582E692C4"><cmd/>
<info>Set <codeph>VENDORID</codeph> to the vendor creating the plug-ins. </info>
</substep>
<substep id="GUID-B5F9FBB6-232B-4508-9C0F-2B49C226AB1A"><cmd/>
<info>Set <codeph>CAPABILITY</codeph> to the capabilities of the plug-in in
the variable. </info>
<info>If the plug-in is assigned no capabilities, only client processes with
no capabilities can use them. </info>
<info>For more information, see <xref href="GUID-9E4D75C0-D797-5541-8E52-3C6D154CC74A.dita">ECom
and the Platform Security Architecture</xref>. </info>
</substep>
<substep id="GUID-596BA5E8-0E55-41F9-925A-BDF0C2743090"><cmd/>
<info>Set <codeph>SOURCEPATH</codeph> to the path where the source files exist. </info>
<info>The path set in this variable must be relative to the path of the project
file. </info>
</substep>
<substep id="GUID-EDBA217E-F553-4B58-99BD-72BFF47237DD"><cmd/>
<info>Set <codeph>SOURCE</codeph> to the name of the source file. </info>
</substep>
<substep id="GUID-90CC5B05-0530-4276-A32B-703A97F77ADF"><cmd/>
<info>Set <codeph>USERINCLUDE</codeph> to the path where the user provided
header files are available. </info>
<info>The path set in this variable must be relative to the path of the project
file. </info>
</substep>
<substep id="GUID-0C3EB2DA-064E-42F0-9D13-BA5B14EC4476"><cmd/>
<info>Set <codeph>SYSTEMINCLUDE</codeph> to<codeph>\epoc32\include\ecom</codeph>. <codeph>SYSTEMINCLUDE</codeph> specifies
the path to OS provided header files. </info>
</substep>
<substep id="GUID-68701E84-5C98-4C37-9F0B-72320E7016A4"><cmd/>
<info>Set <codeph>RESOURCE</codeph> to the registration resource file of the
implementation. </info>
<info>From v9.1, the name of the registration resource file must be the same
as that of the executable. </info>
<info>For example, if the plug-in is <filepath>foo.dll</filepath>, then its
registration resource file must be called <filepath>foo.rsc</filepath>. This
is because plug-in framework uses the names of the registration resource file
to find the plug-in DLLs. </info>
<info>A simple <codeph>START RESOURCE</codeph> statement is of the following
form: </info>
<stepxmp><codeblock id="GUID-B4DAAEEF-0FDA-5192-81F5-650946430C2E" xml:space="preserve">START RESOURCE foo.rss
END</codeblock> </stepxmp>
<info>This builds a file named <filepath>foo.rsc</filepath>. Registration
resource files are always built into the target directory <filepath>\Resource\Plugins</filepath>.
There is no need to explicitly set the target directory for the <filepath>.rsc</filepath> file
in the project file, the build tools take care of it. </info>
<info>Where the registration resource source file is still named after the
UID of the DLL, the built resource file can be renamed to be the same as the
DLL, using the <codeph>TARGET</codeph> keyword. For example: </info>
<stepxmp><codeblock id="GUID-E2636CC2-9658-57CD-B57E-FF244CFE6A59" xml:space="preserve">START RESOURCE 10009DB0.rss
TARGET foo.rsc
END</codeblock> </stepxmp>
<info>This builds the <filepath>10009DB0.rss</filepath> source file into <filepath>\Resource\Plugins\foo.rsc</filepath>. </info>
</substep>
<substep id="GUID-C4476628-A6A3-4A85-9F8D-C11B70EF8A71"><cmd/>
<info>Set the variable <codeph>LIBRARY</codeph> to <filepath>ecom.lib</filepath>. </info>
<info>The binary links against the specified <filepath>.lib</filepath> file. </info>
</substep>
</substeps>
</step>
<step id="GUID-B2656101-01BA-5E5C-9E30-4B28172FC3AD"><cmd/>
<info><p>For creating a plug-in project file for Symbian OS v9.0 and earlier: </p></info>
<substeps id="GUID-B966B7D5-737A-494C-B6E9-74FE8D13DCB5">
<substep id="GUID-157FEA53-CC94-428D-A9AF-529CDBE25120"><cmd/>
<info>Set <codeph>TARGET</codeph> to the standard DLL name. <codeph>TARGET</codeph> contains
the final binary name of the project generated. </info>
</substep>
<substep id="GUID-0FAC1E07-1D7C-4E6D-B317-0234DD58777A"><cmd/>
<info>Set <codeph>TARGETTYPE</codeph> as ECOMIIC. <codeph>TARGETTYPE</codeph> specifies
the type of binary. </info>
</substep>
<substep id="GUID-34D0442D-9176-4B72-BF58-0E22A1268A6A"><cmd/>
<info>Set <codeph>UID</codeph> to the plug-in framework DLL recognition UID
followed by the unique UID of the plug-in. </info>
<info>Unique UID of the plug-in must be the same as the one specified in the <codeph>dll_uid</codeph> member
in the <xref href="GUID-9A9103E4-27B0-5CF3-855A-DCD44795A5C0.dita">registration
resource file</xref>. </info>
</substep>
<substep id="GUID-A9F72D37-A1F9-4586-9FEE-9C7234867E3E"><cmd/>
<info>Set <codeph>SOURCEPATH</codeph> to the path where the source files exist. </info>
<info>The path set for this variable must be relative to the path of the project
file. </info>
</substep>
<substep id="GUID-DE91B9A8-A3EB-4E02-8DA8-7D43F0043A39"><cmd/>
<info>Set <codeph>SOURCE</codeph> to the name of the source file. </info>
</substep>
<substep id="GUID-F9D4D6B1-0F6A-45A3-B9D8-653AFC7DA1BE"><cmd/>
<info>Set <codeph>USERINCLUDE</codeph> to the path where the user provided
header files are available. </info>
<info>The path set in this variable must be relative to the path of the project
file. </info>
</substep>
<substep id="GUID-6B7059F8-3525-4A3A-815B-6AF80FCA2390"><cmd/>
<info>Set <codeph>SYSTEMINCLUDE</codeph> to<codeph>\epoc32\include\ecom</codeph>.
SYSTEMINCLUDE specifies the path to OS provided header files. </info>
</substep>
<substep id="GUID-E3E217A8-607C-474B-911B-98A1CFC6DEA7"><cmd/>
<info>Set <codeph>RESOURCE</codeph> to the registration resource file of the
implementation. </info>
<info>The registration resource file .rss need not have the same name as the
DLL. It is required to be named after the UID of the DLL. </info>
</substep>
<substep id="GUID-D1F69266-3516-4E1F-9A5F-DD9215DBA886"><cmd/>
<info>Set <codeph>LIBRARY</codeph> to <filepath>ecom.lib</filepath>. The binary
links to the <filepath>.lib</filepath> file. </info>
</substep>
</substeps>
</step>
</steps-unordered>
<example id="GUID-D34B6A0A-45E5-5C1F-ABDA-78EB7100622E"><title>Creating an
implementation project file example</title> <p> <b> For Symbian OS v9.1 and
later </b>  </p> <codeblock id="GUID-CBF66575-365D-5587-8435-9B3BE58A0AA2" xml:space="preserve">// ExampleInterfaceImplementation.mmp
//
TARGET     ExampleInterfaceImplementation.dll
TARGETTYPE PLUGIN

// ECom Dll recognition UID followed by the unique dll UID 
UID 0x10009D8D 0x10009DB0

VENDORID 0x70000001

CAPABILITY All -TCB

SOURCEPATH \ExampleInterfaceImplementation
SOURCE     ExampleInterfaceImplementation.cpp

USERINCLUDE  \ExampleInterfaceImplementation \inc
SYSTEMINCLUDE  \epoc32\include
SYSTEMINCLUDE  \epoc32\include\ecom

START RESOURCE 10009DB0.rss
TARGET            ExampleInterfaceImplementation.rsc
END

LIBRARY euser.lib
LIBRARY ecom.lib</codeblock> <p> <b> For Symbian OS v9.0 and earlier </b>  </p> <codeblock id="GUID-B88DE9DD-169C-5F8B-89A6-6B9D50138773" xml:space="preserve">// ExampleInterfaceImplementation.mmp
//
TARGET ExampleInterfaceImplementation.dll
TARGETTYPE ECOMIIC

// ECom Dll recognition UID followed by the unique dll UID 
UID 0x10009D8D 0x10009DB0

SOURCEPATH \ExampleInterfaceImplementation
SOURCE ExampleInterfaceImplementation.cpp

USERINCLUDE  \ExampleInterfaceImplementation \inc
SYSTEMINCLUDE  \epoc32\include
SYSTEMINCLUDE  \epoc32\include\ecom

RESOURCE 10009DB0.rss

LIBRARY euser.lib
LIBRARY ecom.lib</codeblock> </example>
</taskbody></task>