×
Namespaces

Variants
Actions

Using an ECOM component

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code Example
Source file: Media:ECom.zip
Tested with
Devices(s): Nokia N95
Compatibility
Platform(s): S60 3rd Edition, FP1
S60 3rd Edition FP1
Article
Keywords: REComSession, TEComResolverParams
Created: tepaa (20 Feb 2008)
Last edited: hamishwillee (30 May 2013)

Contents

Overview

This code snippet demonstrates how to use an ECom component.

Preconditions and important issues

  • An application that loads an ECom component must call REComSession::FinalClose() in its destructor. It signals the destruction of the interface implementation to ECom.

MMP file

...
 
USERINCLUDE .
SYSTEMINCLUDE \Epoc32\include
SYSTEMINCLUDE \Epoc32\include\ecom
 
...
 
LIBRARY ecom.lib

Source file

TBuf<50> string;
 
// Create the ECom implementation
CHelloEcomIF* ecom = CHelloEcomIF::NewL();
CleanupStack::PushL(ecom);
 
// Call ECom
ecom->SayHello(string);
 
// Delete ECom
CleanupStack::PopAndDestroy(ecom);
 
// Close ECom
REComSession::FinalClose();

PKG file

...
 
; The ECom component
"Epoc32\release\gcce\urel\EComExample.dll"
- "!:\sys\bin\EComExample.dll"
"Epoc32\data\z\resource\plugins\EComExample.rsc"
- "!:\resource\plugins\EComExample.rsc"

Postconditions

The application loads the existing ECom component and calls its interface.

See also

This page was last modified on 30 May 2013, at 07:41.
59 page views in the last 30 days.