Using an ECOM component
Article Metadata
Code Example
Source file: Media:ECom.zip
Tested with
Devices(s): Nokia N95
Compatibility
Platform(s): S60 3rd Edition, FP1
Article
Keywords: REComSession, TEComResolverParams
Created: tepaa
(20 Feb 2008)
Last edited: lpvalente
(21 Jul 2012)
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.


(no comments yet)