Symbian3/PDK/Source/GUID-743BFB3C-7B88-4A5C-A655-A50DEB45FC46.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 16 Jul 2010 17:23:46 +0100
changeset 12 80ef3a206772
permissions -rw-r--r--
Week 28 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 1897, Bug 344, Bug 2681, Bug 463, 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-743BFB3C-7B88-4A5C-A655-A50DEB45FC46" xml:lang="en"><title>Creating
an installer as an in-process plug-in</title><prolog><metadata><keywords/></metadata></prolog><taskbody>
<steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-12-1-5-1-1-6-1-4-1-4-1-3-1-5-1-2-1">
<step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-5-1-1-6-1-4-1-4-1-3-1-5-1-2-1-1"><cmd/>
<info>           <p>Create an ECom plug-in implementation of the <xref href="GUID-CD380D01-8649-36E4-8435-C6F600D5A5CF.dita"><apiname>CSifPlugin</apiname></xref> interface.
For detailed information about creating an ECom plug-in interface implementation,
see the <xref href="GUID-F94CEC6D-C602-550F-9B12-856493F3C509.dita">Implementing
an Interface</xref> section. </p> <p>For example: </p> <codeblock id="GUID-C49BDE13-8928-5305-80A7-C5FDE77C9CF5" xml:space="preserve">Class CSamplePlugin : public CSifPlugin
    {
public:
    static CSamplePlugin* NewL();
    ~CSamplePlugin();

    //Define all virtual functions of CSifPlugin
    ...
  
    void GetComponentInfo(const TDesC&amp; aFileName, const TSecurityContext&amp; aSecurityContext,
                            CComponentInfo&amp; aComponentInfo, TRequestStatus&amp; aStatus);
    void GetComponentInfo(RFile&amp; aFileHandle, const TSecurityContext&amp; aSecurityContext,
                            CComponentInfo&amp; aComponentInfo, TRequestStatus&amp; aStatus);
    
    void Install(const TDesC&amp; aFileName, const TSecurityContext&amp; aSecurityContext,
                    const COpaqueNamedParams&amp; aInputParams, COpaqueNamedParams&amp; aOutputParams,
                    TRequestStatus&amp; aStatus);

    ...

private:
    CSamplePlugin() {}
    void ConstructL();
    CSamplePlugin(const CSamplePlugin &amp;);
    CSamplePlugin &amp; operator =(const CSamplePlugin &amp;);
    };</codeblock>         </info>
</step>
<step id="GUID-48B8E4D6-8D55-414F-A33F-2D1C597A4A6F"><cmd>Export the implementation factories by declaring an array containing
the ECom implementation and an appropriate exported function. For detailed
information about exporting the implementation factories, see the <xref href="GUID-895A685E-83E8-51A3-A823-3A0E07B1E609.dita">Exporting
the Implementation Factories </xref> section.</cmd>
</step>
<step id="GUID-16AC7BCD-3445-4615-8E82-73EBBE7592C7"><cmd/>
<info><p>Publish the properties of your ECom implementation in a registration
resource file. For detailed information publishing the properties in a registration
resource file, see the <xref href="GUID-9A9103E4-27B0-5CF3-855A-DCD44795A5C0.dita">Providing
registry information</xref> section. </p> <p>For example: </p> <codeblock id="GUID-525E615B-4843-5C26-AC11-80CE4F421474" xml:space="preserve">// ECOM DLL UID:            0x1028634F
// ECOM interface UID:        0x10285BC2 (KUidSifPlugin)
// ECOM Implementation:        0x10286350

#include &lt;ecom/registryinfo.rh&gt;

RESOURCE REGISTRY_INFO so_registry
    {
    dll_uid = 0x1028634F;
    interfaces =
        {
        INTERFACE_INFO
            {
            interface_uid = 0x10285BC2;
            
            implementations =
                {
                IMPLEMENTATION_INFO
                    {
                    implementation_uid = 0x10286350;
                    version_no = 1;
                    default_data = "";
                    opaque_data = "";
                    }
                };
            }
        };
    }</codeblock></info>
</step>
<step id="GUID-D838CBF1-6607-4DE8-B9ED-8D86838BE4DD"><cmd>Create a DLL with target type as <codeph>plugin</codeph>. </cmd>
</step>
</steps>
</taskbody></task>