Getting Eikon environment pointer

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): Nokia N95
Platform(s): S60 3rd Edition, MR
Keywords: CEikonEnv, iEikonEnv
Created: tepaa (10 Jun 2008)
Last edited: lpvalente (18 May 2014)



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:

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
// 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
// Calling some method from Eikon pointer
CEikAppUi* ui = CEikonEnv::Static()->EikAppUi();
This page was last modified on 18 May 2014, at 22:09.
69 page views in the last 30 days.