Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



How to provide registry information

An implementation collection publishes the properties of its implementations in a compiled resource file. The ECom framework reads all such resource files to find the interface implementations available on the system. Collections can be added, removed, or altered at any time.

ECom provides two versions of the resource structure types from which registration resource files are built:


Writing a standard registration resource file

To write a standard registration resource file:

Example

The following example gives a resource registration file for an implementation collection with two implementations.

// 10009DB1.RSS
//
#include "RegistryInfo.rh"

RESOURCE REGISTRY_INFO theInfo
{
dll_uid = 0x10009DB1;
interfaces = 
    {
    INTERFACE_INFO
        {
        interface_uid = 0x10009DC0;
        implementations = 
            {
            IMPLEMENTATION_INFO
                {
                implementation_uid = 0x10009DC3;
                version_no = 1;
                display_name = "Implementation name 1";
                default_data = "text/wml";
                opaque_data = "some extra data";
                },
            IMPLEMENTATION_INFO
                {
                implementation_uid = 0x10009DC4;
                version_no = 1;
                display_name = "Implementation name 1";
                default_data = "text/xml||Type of data handled";
                opaque_data = "";
                }
            };
        }
    };
}

[Top]


Writing a version 2 registration resource file

Writing a version 2 registration resource file is the same as writing a writing a standard registration resource file, but with the following additions and differences:

Example

The following example gives a resource registration file for an implementation collection with two implementations; the first cannot be overridden by a RAM-based plug-in; the second can be overridden by a RAM-based plug-in.

// 10009DB1.RSS
//
#include "RegistryInfoV2.rh"

RESOURCE REGISTRY_INFO theInfo
{
// resource_format_version must always be set as follows
resource_format_version = RESOURCE_FORMAT_VERSION_2;

// Normal plug-in parameters
dll_uid = 0x10009DB5;
interfaces = 
    {
    INTERFACE_INFO
        {
        interface_uid = 0x10009DC9;
        implementations = 
            {
            IMPLEMENTATION_INFO
                {
                implementation_uid = 0x10009DCA;
                version_no = 1;
                display_name = "Example Implementation - ROM-only ";
                default_data = "text/wml";
                opaque_data = "";
    
                // This implementation CANNOT be overridden by a RAM-based plug-in
                rom_only = 1;
                },
            IMPLEMENTATION_INFO
                {
                implementation_uid = 0x10009DCB;
                version_no = 1;
                display_name = "Example Implementation - not ROM-only ";
                default_data = "text/wml";
                opaque_data = "";

                // This implementation CAN be overridden by a RAM-based plug-in
                rom_only = 0;
                }
            };
        }
    };
}