Handle Global Variable Example

This example demonstrates:

How to handle global variables within the library code

How to use WSD (Writable Static Data) in dll

Download

Click on the following link to download the example: handleglobalvar.zip

Click: browse to view the example code.

Design and Implementation

The following sections provide information about the implementation of the example.

Capabilities

The program capabilities are defined in globalvarex.mmp: CAPABILITY NONE. Libwsddll library capabilities are defined inlibwsddll.mmp file: CAPABILITY ALL -TCB.

Application Launching

The application can be launched by executing globalvarex from eshell.

libwsd library

This library is used to get/set dll global Data. It demonstrates how to handle WSD (Writable Static Data).

How to handle WSD in dll

Collect all global variables within the structure TWsdData and creat the instance whenever it's required. For target release, use global variables and add EPOCALLOWDLLDATA in the library mmp file. wsddll.h and wsddll.cpp implement the concept of how to handle WSD data in Dll.

Building and Using

To build the handleglobalvar example application, go to the handleglobalvar\group directory and build the application. The definition for the whole application can be found in the bld.inf file in the group subdirectory of the applications main directory.