Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



How to provide a custom resolver

A default resolver that selects an implementation to use is provided as part of ECom. If the algorithm used by that is inappropriate, an interface definition can provide its own custom resolver.

Custom resolvers are themselves interface implementations that implement the ECom CResolver interface. They are instantiated by ECom as required, in response to REComSession::CreateImplementationL() calls that specify to use a particular custom resolver. Custom resolvers must confirm to other aspects of interface implementations, including providing registration resource information, and publishing its UID and factory function in an implementation proxy table.

A custom resolver class should derive from CResolver and implement:

Additionally, in order to be trusted by ECom, the plug-in should have the ProtServ capability set in its project file.

Example

The following shows the public interface of an example custom resolver.

class CExampleResolver : public CResolver
    {
public:
    // Factory function: 
    static CExampleResolver* NewL(MPublicRegistry& aRegistry);
    ~CExampleResolver();

    // Implement CResolver
    TUid IdentifyImplementationL(TUid aInterfaceUid, 
    const TEComResolverParams& aParameters) const;
    RImplInfoArray* ListAllL(TUid aInterfaceUid, 
    const TEComResolverParams& aParameters) const;

Example

The following shows the registration resource required by a custom resolver. The interface_uid value is always 0x10009D90. Other UIDs are specific to individual resolvers. The display_name, default_data, and opaque_data fields are unused.

RESOURCE REGISTRY_INFO theInfo
    {
    dll_uid = 0x10009DB3;
    interfaces = 
        {
        INTERFACE_INFO
            {
            interface_uid = 0x10009D90;
            implementations = 
                {
                IMPLEMENTATION_INFO
                    {
                    implementation_uid = 0x10009DB4;
                    version_no = 1;
                    display_name = "";
                    default_data = "";
                    opaque_data = "";
                    }
                };
            }
        };
    }