This page was last modified 10:32, 1 July 2008.
CS001057 - Getting Eikon environment pointer
From Forum Nokia Wiki
| ID | CS001057 | Creation date | July 1, 2008 |
| Platform | S60 3rd Edition, MR | Tested on devices | Nokia N95 |
| Category | Symbian C++ | Subcategory | Code Examples |
| Keywords (APIs, classes, methods, functions): CEikonEnv, iEikonEnv |
Overview
The following code snippet shows how to get an Eikon environment handle in a UI application.
Every GUI application is provided with an instance of CEikonEnv by the framework, which can be accessed through either CEikonEnv::Static() or the iEikonEnv macro of CEikApplication that uses iCoeEnv.
MMP file
The following capabilities and libraries are required:
CAPABILITY NONE
LIBRARY eikcore.lib
Getting pointer with iEikonEnv macro of CEikApplication
This can be used, for example, in CAknAppUi, CAknView, and CCoeControl. These classes have iCoeEnv as the member variable that is needed when using the iEikonEnv macro. The iEikonEnv macro is defined in the eikdef.h header.
// Getting Eikon environment pointer iEikonEnv; // Calling some method from Eikon pointer CEikAppUi* ui = iEikonEnv->EikAppUi();
Using CEikonEnv::Static()
CEikonEnv::Static() should be used in, for example, the application engine class because iCoeEnv is not a member variable. CEikonEnv is defined in the eikenv.h header.
// Needed includes #include <eikdef.h> #include <eikenv.h> // Getting Eikon environment pointer CEikonEnv::Static(); // Calling some method from Eikon pointer CEikAppUi* ui = CEikonEnv::Static()->EikAppUi();
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Send SMS at some interval | RB_Sahu | Symbian Networking & Messaging | 30 | 2008-09-27 20:56 |
| A question about CBA / CommandButton | pgivy | General Symbian C++ | 6 | 2007-02-13 15:19 |
| py2sis Environment Veriable | Faisal Rehman | Python | 24 | 2008-07-19 17:29 |
| 6220 and Separate Delivery | umesh_singhal | Digital Rights Management & Content Downloading | 9 | 2003-12-08 12:00 |
| EIKON MFNE 11 Panic | mikedeklerk | General Symbian C++ | 6 | 2008-05-27 14:54 |

