Symbian3/SDK/Source/GUID-6482956D-C3A3-5B68-A37F-4250C85B0D82.dita
changeset 13 48780e181b38
parent 12 80ef3a206772
child 14 578be2adaf3e
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
     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-6482956D-C3A3-5B68-A37F-4250C85B0D82" xml:lang="en"><title>Polymorphic
       
    13 interface DLLs</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>A polymorphic DLL contains an interface defined by a gate function and
       
    15 an abstract class with at least one virtual function. </p>
       
    16 <p>The polymorphic DLL exports the gate function at ordinal 1, which typically
       
    17 constructs a concrete class derived from the abstract interface. The virtual
       
    18 function is then called, and the functions of the class are available. </p>
       
    19 <p>Examples of polymorphic DLLs in Symbian platform include ECom plug-ins,
       
    20 device drivers, Front End Processors, and many more. </p>
       
    21 <p>Each type of interface should specify its own UID, which is used as <codeph>uid2</codeph> for
       
    22 the polymorphic DLL. </p>
       
    23 <p>The function responsible for loading a polymorphic DLL should check that
       
    24 its <codeph>uid2</codeph> corresponds with the expected interface type. </p>
       
    25 <p>For polymorphic DLLs, the interpretation of <codeph>uid3</codeph> depends
       
    26 on the interface type. <codeph>uid3</codeph> may not be required by all interfaces. </p>
       
    27 <p>The build process for a polymorphic DLL produces an import library, but
       
    28 it is not used. </p>
       
    29 <section><title>mmp project specification</title><p>The project
       
    30 file for a polymorphic DLL must specify the correct target type and UIDs:</p><ul>
       
    31 <li id="GUID-0E19AFC8-5242-561B-B9DC-085839CF8604"><p>Specify the <codeph>TARGETTYPE</codeph> line
       
    32 as: </p> <codeblock id="GUID-89A9AD1C-3A1D-5733-B8DD-BE40ECAC747C" xml:space="preserve">TARGETTYPE dll</codeblock> <p>This
       
    33 implicitly specifies <codeph>UID1</codeph> correctly. Note that some types
       
    34 of polymorphic DLLs, have particular support by the build tools, and have
       
    35 their own different target types. See <xref href="GUID-A27A05A2-B161-54D2-92E0-8620B01BFD44.dita">Polymorphic
       
    36 DLL targettype summary</xref>. </p> </li>
       
    37 <li id="GUID-778C0445-7C95-53F9-AA52-69C37416782C"><p>Specify the UID for
       
    38 the DLL in a <codeph>UID</codeph> line: </p> <codeblock id="GUID-CB104F6E-EB57-54EC-8403-B2D4F8BB35D6" xml:space="preserve">UID &lt;UID2&gt; &lt;UID3&gt;</codeblock> <p>The <varname>UID2</varname> value is defined by the interface which is being implemented.
       
    39 Some types of polymorphic DLL also require a third UID, but, if so, its meaning
       
    40 is defined by the DLL. </p> </li>
       
    41 </ul></section>
       
    42 <example><p>An example of a project file (<filepath>PolymorphicDLL1.mmp</filepath>)
       
    43 for a polymorphic DLL is given below.</p><codeblock id="GUID-85177FF3-7CEC-5DC5-9014-972E33D605C6" xml:space="preserve">TARGET        PolymorphicDLL1.dll
       
    44 TARGETTYPE    dll
       
    45 UID           0x10004262 0x10004264
       
    46 SOURCEPATH    .
       
    47 SOURCE        PolymorphicDLL1.cpp
       
    48 USERINCLUDE   .
       
    49 USERINCLUDE   ..\UsingDLLs
       
    50 SYSTEMINCLUDE \Epoc32\include
       
    51 LIBRARY       euser.lib
       
    52 EXPORTUNFROZEN</codeblock></example>
       
    53 </conbody></concept>