One of the Symbian operating system structures: DLL

Source: Internet
Author: User

* DLL (Dynamic Link Library) is a compiled C ++ code that can be loaded by an ongoing process.

* The DLL in the Symbian operating system is mainly divided into two types:
-Shared Library DLL (static interface)
-Multi-state interface DLL (plug-in)

 

* Shared library DLL
-The Shared library exports API functions according to the module definition file (. Def ).
-The number of exported functions is arbitrary.
-Each export function is an entry point of the DLL.
-The Shared Library publishes a header file (. h) and a import/export warehouse (. Lib) for parsing and exporting functions.
-When the executable code of the shared library is used for running, the operating system loader loads all the DLL files used by the Library and other DLL files used by these DLL files.
 
* Multi-state interface DLL
-Implement the abstract interface defined separately by the Framework
-Different Extensions are usually used to indicate the essential differences between DLL, for example
• Use of File System plug-ins. FSY
• Protocol module plug-in use. PRT
-Has a separate access point "Factory" function for instantiation.
-It is usually used to implement different implementations (plug-ins) of fixed interfaces)
-Starting from the Symbian operating system v7.0, the most common plug-in is the ECOM plug-in.

 

* The UID used by DLL
-The Symbian operating system uid is 32-bit and is used to uniquely identify the file type.
-The Symbian operating system uses three uid combinations to uniquely identify a binary executable file
-For DLL, the three UIDs are
• Uid1: system range differentiation between EXE and DLL
-For EXE, targettype is exe (targettype is defined in the MMP file)
-For Shared libraries, the targettype is DLL.
-For the multi-state ECOM plug-in DLL, targettype is plugin
• Uid2: differentiate shared DLL and multi-state interface DLL
• Uid3: uniquely identifies a component and requires a Symbian signature.

* Export functions from DLL
-Shared Library DLL provides access to its API through the Export Function
-In the Symbian operating system, each function to be exported must be added with the import_c macro before its header file definition.
-Add export_c to the. cpp file for the corresponding function.
Class cmyexample: Public csomebase
{
Public:
Import_c static cmyexample * newl ();
Public:
Import_c void Foo ();
............
};

Export_c cmyexample * cmyexample: newl ()
{......}

Export_c void cmyexample: Foo ()
{......}

* Principles for exporting functions from DLL
-Inline functions cannot be exported because they are unnecessary.
· You do not need to export data. The caller can access the data through the header file.
-Only functions outside the DLL need to be exported.
· Private functions cannot be accessed by clients
-All virtual functions, whether public, protected, or private, should be exported.
· The Derived classes may be re-implemented.

 

* Query functions by order and by name
-In most operating systems, DLL access points can be identified by their names or in the order they are exported.
-The Symbian operating system does not provide a function by name, because it causes additional overhead for the DLL size.
-The Symbian operating system only supports searching functions in sequence.
· The release of DLL versions must ensure the sequence immutability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.