Porting Control Panel Plug-ins

The purpose of this document is to help migrate polymorphic DLLs to plug-ins as applications.

Introduction

Different control panel plug-ins are likely to need different capabilities in order to change the phone's configuration. Rather than each plug-in running in a parent process with a dangerously large set of capabilities, each plug-in should run in its own process, so that each can have the minimal set of capabilities that it requires. For this reason, the decision was made to convert all existing control panel plug-ins, which are implemented as polymorphic DLLs, into standard applications, but with a special registration file. This registration file is used by the application server to distinguish the plug-in from a normal application.

Required background

  • The control panel application must be located in \sys\bin\<appname.exe>. Only executables (EXEs and DLLs) must exist in \sys\bin\.

  • The control panel application's UI resource file must be located in \Resource\apps\<appname.rsc>.

  • There must be a registration resource file for each control panel application in

    \private\10003a3f\apps\ if it is either on the emulator or built into the ROM, or

    \private\10003a3f\import\apps\ if it is installed using SWI.

Source code changes

Each existing control panel plug-in has only one exported function, which is called by default. To convert the plug-in into an application, the four classes which are required components of any application must be provided, for example:

Note: that each System GUI provides its own application, app UI and document base classes.

The executable's entry points need to be modified as follows:

LOCAL_C CApaApplication* NewApplication()
    {
 return new CExampleApplication;
    } 
GLDEF_C TInt E32Main()
    {
    return EikStart::RunApplication(NewApplication);
    } 
#if defined(__WINS__) && !defined(EKA2) 
GLDEF_C TInt E32Dll(TDllReason)
    {
    return KErrNone;
    } 
EXPORT_C TInt WinsMain(TDesC* aCmdLine)
    {
    return EikStart::RunApplication(NewApplication, aCmdLine);
    } 
#endif

Resource and MMP file changes

For details on converting existing control panel plug-ins into applications, refer to the migration document: Porting apps to exes.

Related information
Secure Software Install