Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How to implement a polymorphic interface DLL

The following code fragments show a simple implementation of a polymorphic interface DLL. The DLL being implemented is the one whose interface is defined by the CMessenger class.

This example implementation issues a greeting in French.

[Top]


The concrete class declaration

Declare a concrete class, called CFrenchMessenger, as follows:

class CFrenchMessenger : public CMessenger
      {
public:
    virtual void ConstructL(CConsoleBase* aConsole, const TDesC& aName);
    virtual ~CFrenchMessenger();
    virtual void ShowMessage();
    };

[Top]


Notes:

[Top]


Implementation

Start the implementation code as follows:

GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
    {
    return(KErrNone);
    }


EXPORT_C CMessenger* NewMessengerL()
    {
    return new (ELeave) CFrenchMessenger;
    }

[Top]


Notes: