I'm working on porting my VoIP application from S60 3rd to S60 2nd (yes, 9.1 -> 8.1). I faced a problem starting GUI applications from EXE because there's no EikStart::RunApplication() method implemented in eikcore.dll on S60 2nd. I cannot use ordinary APP/DLL model because my application is heavily loaded with static and global data (I use 3rd party Speex codecs and some other C libraries which were not adopted to S60 and I cannot fix it so I have to live with that).
My question is how does S60 2nd start GUI ? i.e. what is the proper algorithm inside eikcore.dll which implements UI framework for starting applications ? I was experimenting alot and came to the following startup code which is only half the way to my goal .
GLDEF_C int ExeMainL()
CEikonEnv *coe = CEikonEnv::Static();
CEikProcess *p = (CEikProcess*)CApaProcess::NewL(r);
CEikDocument *doc = (CEikDocument*) p->AddNewDocumentL(NewApplication);
CEikAppUi *ui = doc->CreateAppUiL();
// .. something else must be initialized here befoe calling ConstructL()
GLDEF_C TInt E32Main()
CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
CEikonEnv* coe = new CEikonEnv;
__ASSERT_ALWAYS(!err, User::Panic(_L("CUSTOM1"), err));
This code uses CEikDocument::AddNewDocumentL(NewApplication) to construct the document, and it seems it is working. The problem here is that when I call ui->ConstructL() second stage constructor to construct my application document, it fails right after calling into BaseConstructL() (inside the app itself) with Panic 3 which means some uninitialized pointer was used.
Has someone any ideas on how to:
1. run GUI apps on S60 2nd like EikStart::RunApplication() does it on 3rd from exe?
2. Or how to mimic EikStart::RunApplication() on S60 2nd ?
3. Or what I have forgotten to initilize in my custom starter code ?
4. Or is there any place on the net where I can download a source code for eikcore.dll from ? ;-)
I will be very thankful, I spent last two weeks fighting this problem without any luck, I believe you know what my feelings are now .