Helloworldbasic Research Summary (II)

Source: Internet
Author: User

DLL entry point description:
When an applicationProgramAt startup, e32dll is called with a parameter areason. This parameter may be one of the following edllprocessattach, edllthreadattach, edllthreaddetach or edllprocessdetach.
E32dll is a global function and cannot be referenced as the DLL entry point. This function must appear in the Symbian program.
In this project, the function simply returns a kerrnone to indicate that there is no problem. You must use this entry point to initialize or reset the local storage of the thread.
Finally, note that although the entry point is called by the simulator, it is not called by default on the target device. It must be added to the MMP file. Example: epoccalldllentrypoints

Description of creating an application object:
Note that the newapplication method is exported by DLL, And the export_c modifier is added before the function name. If the export_c character is missing,CodeThe connection fails.
The framework first calls this function and exports it. This means that the newapplication method must be the first in the def file. By default, the tool chain automatically makes sure that the function is the first.
Note that its construction does not use the general new (eleave) method, but the C ++ style new. This is because the trap macro has not been created by the application. If the system cannot allocate memory to the application instance, the returned pointer is null. The framework checks if necessary.

Description of creating app UI and view objects:
Note: It is difficult to use the two-segment structure provided by the Symbian system to create Appui objects. Instead, call the construction of C ++ and return a pointer to the created instance to the framework. The framework then calls constructl to complete the construction. The app UI gives ownership to the framework, so the document object does not have to be destroyed.

re-painting screen Description:
the draw function is called by the Framework. When the view needs to be re-painted, it also contains all the code to draw the view. Note that the framework only calls the draw method to respond to general system events. Therefore, programmers cannot directly call the draw method. The graphic context of the system must be activated before the call. The alternative is to re-paint the screen by calling the drawnow method.
Note: The draw method cannot exit unexpectedly. This is because the call is completed directly by the framework, and the framework does not know how to handle captured errors. Instead, the draw function must trap and handle any errors.

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.