Symbian game programming (3) Introduction to Application Development

xiaoxiao2021-03-06  57

III. Introduction to Application Development

3.1 Symbian Application Type Introduction

The binary code compiled in the Symbian OS is made of three target types, EXE, APP, and DLL.

3.2 Development of EXE program

When our application does not require a user interface, we can create a .exe program when we need to use a separate process. The .exe program contains a master entry E32MAIN (), when the system is started by E32MAIN (), the system creates a new process and creates a new thread in this process. When you create an EXE program, we need to specify the Target of the program to EXE in the .mmp file. EXE is usually a server or command line program, usually hidden, he doesn't have a GUI, and cannot run directly from the main menu.

Below is the MMP file for the most basic console application:

Target console.exe

Targettype EXE

Uid 0x100039ce 0x10005B91

TargetPath / System / Apps / Console

SourcePath ../src

Userinclude ../in

SYSTEMINCLUDE / EPOC32 / INCLUDE

Systeminclude / EPOC32 / include / libc

Source e32main.cpp console.cpp

Library Euser.lib

After we compile the program, console.exe will generate. After packaging the program, we can't run this program directly. There are two ways to run this program, and the first is to run through other programs, and the second is to select this program and then run using the file browser using the Seleq.

Here we implement a CONSOLE class to display the text on the side. We can do not implement the Console class when designing a background program so that the program is running on the screen at the screen.

3.3 Development of App Programs

When we created applications need to use the user interface, we need to create an App program. An App program may include custom strings, menu items, dialogs, and more. If we want to create an App program, we need to specify the Target of the program as app in the .mmp file.

Our most familiar helloWorld is a simple app program, below it is its MMP file:

Target HelloWorldbasic.App

TargetType App

Uid 0x100039ce 0x10005B91

TargetPath / System / Apps / HelloWorldbasic

SourcePath ../src

Source helloworldbasic.cpp

Source HelloWorldBasicApplication.cpp

Source HelloWorldBasicappview.cpp

Source HelloWorldBasicappui.cpp

Source HelloWorldBasicDocument.cpp

Sourcepath ../group

Resource helloworldbasic.rss

Userinclud ../inc

SYSTEMINCLUDE / EPOC32 / INCLUDE

Library Euser.lib

Library apparc.lib

Library cone.lib

Library Eikcore.liblibrary avkon.lib

After compiling, we will get helloworldbasic.app, after packaging, we can choose to run this program directly, see the following figure.

3.4 Development of the DLL program

The DLL provides multiple portions, and is called by the system or the existing thread (process).

There are two types of DLL, static DLL and polymorphic DLL.

Static DLL provides a list of methods for other programs for call. The static DLL is read in memory when the program started.

Polymorphism DLL provides a fixed way to other programs. For example, a GUI application provides a newApplication () method to initiate an application. These DLLs implement abstract ways, such as a printer driver, a Socket protocol, or an application. Their extensions are mostly .dll, but PRN, PRT or APP, etc. They inherit from class associated with DLL and usually only read when they need them. The previous App program also calculates a polymorphic DLL.

If we want to create a DLL program, we need to specify the Target of the program as a DLL in the .mmp file. As follows:

Target test.dll

Targettype DLL

UID 0x1000008D 0x0cd52435

SourcePath ../src

Source test.cpp

Userinclud ../inc

SYSTEMINCLUDE / EPOC32 / INCLUDE

Library Euser.lib

转载请注明原文地址:https://www.9cbs.com/read-83776.html

New Post(0)