Each native module DLL must implement and export functions which serve as entry points into the DLL: the first will be called by the m runtime system to create the module instance, the second is only needed in Symbian 2nd Edition, imposed by the rules for DLLs. Symbian 3rd/5th Edition defines the symbol EKA2 (EPOC Kernel Architecture 2) which can be used to omit the function.
|
// the first exported function creates an instance of this module EXPORT_C NativeModule* NewWorldModuleL() { return new(ELeave) WorldModule; } // the second exported function is required by DLL conventions // (Symbian 2nd Edition only) #ifndef EKA2 GLDEF_C TInt E32Dll(TDllReason) { return KErrNone; } #endif |
For a DLL, the name of the first exported function (NewWorldModuleL here) does not matter. However, to support static linking in standalone applications[2], the function name must be of the form NewNameModuleL, where Name ist the name of your module, with the first character uppercase and all others lowercase. See chapter * (Reference) for more information about producing statically linked standalone applications.