×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    22

    Midlet Launcher C++ application silently dies on device

    Hi,

    I am developing an S60 3rd ed application for which one of the requisites is to launch a pre-installed Midlet.
    I have basically been following this method to do so : http://wiki.forum.nokia.com/index.ph...60_3rd_Edition



    Here is my code :


    Code:
    /*
     ============================================================================
     Name		: MidletLaunchGUIAppUi.cpp
     
    ============================================================================
     */
    
    // INCLUDE FILES
    #include <avkon.hrh>
    #include <aknmessagequerydialog.h>
    #include <aknnotewrappers.h>
    #include <stringloader.h>
    #include <f32file.h>
    #include <s32file.h>
    #include <hlplch.h>
    
    
    
    
    
    #include <MidletLaunchGUI_0x2001FFC0.rsg>
    
    #include "MidletLaunchGUI_0x2001FFC0.hlp.hrh"
    #include "MidletLaunchGUI.hrh"
    #include "MidletLaunchGUI.pan"
    #include "MidletLaunchGUIApplication.h"
    #include "MidletLaunchGUIAppUi.h"
    #include "MidletLaunchGUIAppView.h"
    
    _LIT(KFileName, "C:\\private\\2001FFC0\\MidletLaunchGUI.txt");
    _LIT(KText, "foooo!");
    
    
    
    
    
    
    
    
    
    // midlet name
    _LIT(KMidletName, "HelloMIDlet");
     
    // KVM virtual machine location on ROM drive
    _LIT(KMidRunROMLocation, "z:\\system\\programs\\kmidrun.exe");
     
    // location of jad + jar
    _LIT(KMidletJadLocation, "c:\\system\\apps\\MidLaunch\\Hello.jad");
    _LIT(KMidletJarLocation, "c:\\system\\apps\\MidLaunch\\Hello.jar");
    _LIT(KMidletFakeExtension, ".fakeapp");
    
    
    
    
    
    void CMidletLaunchGUIAppUi::FindMidletUIDL(){
    
    	
        
        //the caption we are looking for converted as a TBUF
        //TBuf<KApaMaxAppCaption> wantedCap;
        //wantedCap.Append(KMidletName);
        
        User::LeaveIfError( apaSession.Connect() );
        CleanupClosePushL( apaSession );
        User::LeaveIfError( apaSession.GetAllApps() );
       
        while ( apaSession.GetNextApp( appInfo ) == KErrNone )
        {
        
    
    	    // Caption of the MIDlet can be read from appInfo.iCaption
    	    // When the MIDlet to be launch is found, store its UID
    	    // (appInfo.iUid) for later use.
        	
        	
        	TInt bla = appInfo.iFullName.Right(8).Compare(KMidletFakeExtension);
        	
    	    if(bla == 0)
    	    {
    	    	
    	    TBuf<KApaMaxAppCaption> appCaption;
    	   
    	    TInt found = appInfo.iCaption.Compare(KMidletName);
    	    
    	    if(found == 0){
    		    KMidletUid =  appInfo.iUid;
    	    }
    	    
    	 
    	   // _LIT(KMidletName, "   " + );
    	  
    	    }	    
    	   
        }
        
       
    
    }
    
    
    void CMidletLaunchGUIAppUi::LaunchMidletL()
    	{
    
    	
    	
    	 TThreadId threadId;
    	 apaSession.StartDocument(_L(""), KMidletUid, threadId);
    
    	
    	
    	
    	TBuf<KMaxCommandLine> cmdLine;
    	_LIT(KSeparator, "*");
    
    	// cmd line syntax: PortNumber*MIDletUid*MIDletName*JarLocation*JadLocation*
    
    	cmdLine.AppendNum(KMidletPort);
    	cmdLine.Append(KSeparator);
    
    	// append a midlet uid in decimal format to the command line
    	TBuf<16> uidNum;
    	 
    	uidNum.Num(KMidletUid.iUid,EDecimal);
    	cmdLine.Append(uidNum);
    	cmdLine.Append(KSeparator);
    
    	// append a midlet name to the command line
    	cmdLine.Append(KMidletName);
    	cmdLine.Append(KSeparator);
    
    	// append a jar file location to the command line
    	cmdLine.Append(KMidletJarLocation);
    	cmdLine.Append(KSeparator);
    
    	// append a jad file location to the command line
    	cmdLine.Append(KMidletJadLocation);
    	cmdLine.Append(KSeparator);
    
    	
    	// create a new process
    	RProcess process;
    
    	TInt error = process.Create(KMidRunROMLocation,cmdLine);
    	User::LeaveIfError(error);
    
    	// TODO: process should be renamed according to convention used with KVM
    
    	process.Resume();
    	process.Close();
    
    }
    
    // ============================ MEMBER FUNCTIONS ===============================
    
    
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::ConstructL()
    // Symbian 2nd phase constructor can leave.
    // -----------------------------------------------------------------------------
    //
    void CMidletLaunchGUIAppUi::ConstructL() {
    	// Initialise app UI with standard value.
    	BaseConstructL(CAknAppUi::EAknEnableSkin);
    
    	
    	
    	
    	
    	
    	// Create view object
    	iAppView = CMidletLaunchGUIAppView::NewL(ClientRect() );
    
    	// Create a file to write the text to
    	TInt err = CCoeEnv::Static()->FsSession().MkDirAll(KFileName);
    	if ( (KErrNone != err) && (KErrAlreadyExists != err)) {
    		return;
    	}
    
    	RFile file;
    	err = file.Replace(CCoeEnv::Static()->FsSession(), KFileName, EFileWrite);
    	CleanupClosePushL(file);
    	if (KErrNone != err) {
    		CleanupStack::PopAndDestroy(1); // file
    		return;
    	}
    
    	RFileWriteStream outputFileStream(file);
    	CleanupClosePushL(outputFileStream);
    	outputFileStream << KText;
    
    	CleanupStack::PopAndDestroy(2); // outputFileStream, file
    
    	
    	
    	
    	FindMidletUIDL();
    	LaunchMidletL();
    }
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::CMidletLaunchGUIAppUi()
    // C++ default constructor can NOT contain any code, that might leave.
    // -----------------------------------------------------------------------------
    //
    CMidletLaunchGUIAppUi::CMidletLaunchGUIAppUi() {
    	// No implementation required
    }
    
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::~CMidletLaunchGUIAppUi()
    // Destructor.
    // -----------------------------------------------------------------------------
    //
    CMidletLaunchGUIAppUi::~CMidletLaunchGUIAppUi() {
    	if (iAppView) {
    		delete iAppView;
    		iAppView = NULL;
    	}
    
    	
    }
    
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::HandleCommandL()
    // Takes care of command handling.
    // -----------------------------------------------------------------------------
    //
    void CMidletLaunchGUIAppUi::HandleCommandL(TInt aCommand) {
    	switch (aCommand) {
    		case EEikCmdExit:
    		case EAknSoftkeyExit:
    			Exit();
    			break;
    
    		case ECommand1: {
    
    			// Load a string from the resource file and display it
    			HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT);
    			CAknInformationNote* informationNote;
    
    			informationNote = new ( ELeave ) CAknInformationNote;
    
    			// Show the information Note with
    			// textResource loaded with StringLoader.
    			informationNote->ExecuteLD( *textResource);
    
    			// Pop HBuf from CleanUpStack and Destroy it.
    			CleanupStack::PopAndDestroy(textResource);
    		}
    			break;
    		case ECommand2: {
    			RFile rFile;
    
    			//Open file where the stream text is
    			User::LeaveIfError(rFile.Open(CCoeEnv::Static()->FsSession(), KFileName, EFileStreamText));//EFileShareReadersOnly));// EFileStreamText));
    			CleanupClosePushL(rFile);
    
    			// copy stream from file to RFileStream object
    			RFileReadStream inputFileStream(rFile);
    			CleanupClosePushL(inputFileStream);
    
    			// HBufC descriptor is created from the RFileStream object.
    			HBufC* fileData = HBufC::NewLC(inputFileStream, 32);
    
    			CAknInformationNote* informationNote;
    
    			informationNote = new ( ELeave ) CAknInformationNote;
    			// Show the information Note
    			informationNote->ExecuteLD( *fileData);
    
    			// Pop loaded resources from the cleanup stack
    			CleanupStack::PopAndDestroy(3); // filedata, inputFileStream, rFile
    		}
    			break;
    		case EHelp: {
    
    			CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
    			HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
    		}
    			break;
    		case EAbout: {
    
    			CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
    			dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
    			HBufC* title = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TITLE);
    			dlg->QueryHeading()->SetTextL(*title);
    			CleanupStack::PopAndDestroy(); //title
    			HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
    			dlg->SetMessageTextL(*msg);
    			CleanupStack::PopAndDestroy(); //msg
    			dlg->RunLD();
    		}
    			break;
    		default:
    			Panic(EMidletLaunchGUIUi);
    			break;
    	}
    }
    // -----------------------------------------------------------------------------
    //  Called by the framework when the application status pane
    //  size is changed.  Passes the new client rectangle to the
    //  AppView
    // -----------------------------------------------------------------------------
    //
    void CMidletLaunchGUIAppUi::HandleStatusPaneSizeChange() {
    	iAppView->SetRect(ClientRect() );
    }
    
    CArrayFix<TCoeHelpContext>* CMidletLaunchGUIAppUi::HelpContextL() const {
    #warning "Please see comment about help and UID3..."
    	// Note: Help will not work if the application uid3 is not in the
    	// protected range.  The default uid3 range for projects created
    	// from this template (0xE0000000 - 0xEFFFFFFF) are not in the protected range so that they
    	// can be self signed and installed on the device during testing.
    	// Once you get your official uid3 from Symbian Ltd. and find/replace
    	// all occurrences of uid3 in your project, the context help will
    	// work.
    	CArrayFixFlat<TCoeHelpContext>* array = new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
    	CleanupStack::PushL(array);
    	array->AppendL(TCoeHelpContext(KUidMidletLaunchGUIApp, KGeneral_Information));
    	CleanupStack::Pop(array);
    	return array;
    }
    
    // End of File







    The application automatically launches the midlet as expected but then silently dies and I need it to stay alive after the midlet was launched.

    Moreover, if I comment out the LaunchMidlet() call in ConstructL() the application doesn't even seem to start.

    So I guess the problem should be inside FindMidletUIDL() or somewhere nearby but I can't find where !


    So any help appreciated. This is difficult for me to debug as I can't test it on the emulator and as I can't do on-device debugging ...

    Thanks in advance

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Midlet Launcher C++ application silently dies on device

    I would be surprised if that write attempt to C:\\private\\2001FFC0\\MidletLaunchGUI.txt would be a successful one. Generally you can not write to the private folder of other applications (by the way: why are you trying that?).
    Otherwise you can try to remove the silence of the failure via checking http://wiki.forum.nokia.com/index.ph...ded_panic_code

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    22

    Re: Midlet Launcher C++ application silently dies on device

    Hi Wizard_hu_ ,

    Basically the C:\\private\\2001FFC0\\MidletLaunchGUI.txt part was automatically generated by Carbide when I chose to create a standard Symbian C++ application.

    I removed it now.

    I also tried using the ErrRd file.

    When launching the application raises a E32user Cbase 71 on the phone.

    I must have forgotten to pop something out of the cleanup stack or something similar...

    Can you figure out what ?

    Thanks for helping

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Midlet Launcher C++ application silently dies on device

    just check all places where you push something (including LC-ending functions), first candidate would be apaSession.

  5. #5
    Registered User
    Join Date
    Mar 2006
    Location
    India
    Posts
    503

    Re: Midlet Launcher C++ application silently dies on device

    hi

    User::LeaveIfError( apaSession.Connect() );
    CleanupClosePushL( apaSession );

    ...
    once pushed it should be released ...from the cleanstack
    Last edited by kamaljaiswal; 2008-11-20 at 18:59.
    Regards
    Kamal :)
    ------------------
    You never expect what expects you.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Midlet Launcher C++ application silently dies on device

    Quote Originally Posted by azpublic View Post
    Basically the C:\\private\\2001FFC0\\MidletLaunchGUI.txt part was automatically generated by Carbide when I chose to create a standard Symbian C++ application.
    Sorry about that, forget it. I was thinking that you are trying to access \private\102033E6\MIDlets. But C:\\private\\2001FFC0\\MidletLaunchGUI.txt is just your own private folder, you can freely access it.
    Go for the panic as Jukka and Kamal suggest.

  7. #7
    Registered User
    Join Date
    Jan 2008
    Posts
    22

    Re: Midlet Launcher C++ application silently dies on device

    Thank you all for your replies.

    I managed to corner down one of the problems.
    Unfortunately there seems to be another one.

    Indeed I had forgot to pop apaSession from the stack.

    I now did it but a different error appears.

    Here is my code now.

    Code:
    // INCLUDE FILES
    
    
    //_LIT(KFileName, "C:\\private\\2001FFC0\\MidletLaunchGUI.txt");
    _LIT(KText, "midletLaunch");
    
    // midlet name
    _LIT(KMidletName, "HelloMIDlet");
     
    // KVM virtual machine location on ROM drive
    _LIT(KMidRunROMLocation, "z:\\system\\programs\\kmidrun.exe");
     
    // location of jad + jar
    _LIT(KMidletJadLocation, "c:\\system\\apps\\MidLaunch\\Hello.jad");
    _LIT(KMidletJarLocation, "c:\\system\\apps\\MidLaunch\\Hello.jar");
    _LIT(KMidletFakeExtension, ".fakeapp");
    
    
    void CMidletLaunchGUIAppUi::FindMidletUIDL(){
    
    	
        
        //the caption we are looking for converted as a TBUF
        //TBuf<KApaMaxAppCaption> wantedCap;
        //wantedCap.Append(KMidletName);
        
        User::LeaveIfError( apaSession.Connect() );
        CleanupClosePushL( apaSession );
        User::LeaveIfError( apaSession.GetAllApps() );
       
        while ( apaSession.GetNextApp( appInfo ) == KErrNone )
        {
        
    
    	    // Caption of the MIDlet can be read from appInfo.iCaption
    	    // When the MIDlet to be launch is found, store its UID
    	    // (appInfo.iUid) for later use.
        	
        	RDebug::Print( appInfo.iFullName );	
        	iLog.Write(appInfo.iFullName);
        	RDebug::Print(_L(" "));
        	//iLog.Write(_L(" "));
        	TInt bla = appInfo.iFullName.Right(8).Compare(KMidletFakeExtension);
        	
    	    if(bla == 0)
    	    {
    	    	RDebug::Print(_L("we found a .fakeapp"));
    	    	iLog.Write(_L("we found a .fakeapp"));
    	    TBuf<KApaMaxAppCaption> appCaption;
    	   
    	    TInt found = appInfo.iCaption.Compare(KMidletName);
    	    
    	    if(found == 0){
    		    KMidletUid =  appInfo.iUid;
    		    iLog.Write(_L("midlet found"));
    	    }
    	    
    	 
    	   // _LIT(KMidletName, "   " + );
    	  
    	    }	    
    	    RDebug::Print(_L("after if "));
    	    iLog.Write(_L("after if "));
        }
        
        RDebug::Print(_L("after while "));
        iLog.Write(_L("after while "));
    
        CleanupStack::PopAndDestroy();
    }
    
    
    void CMidletLaunchGUIAppUi::LaunchMidletL()
    	{
    
    	RDebug::Print(_L("--------------------- > inside launch midlet"));
    	iLog.Write(_L(" --------------------- > launching midlet "));
    	
    	
    	 TThreadId threadId;
    	 RDebug::Print(_L("1"));
    	 iLog.Write(_L("1"));
    	 User::LeaveIfError( apaSession.Connect() );
    	 CleanupClosePushL( apaSession );
    	 apaSession.StartDocument(_L(""), KMidletUid, threadId);
    	 RDebug::Print(_L("2"));
    	 iLog.Write(_L("2"));
    	
    	
    	
    	TBuf<KMaxCommandLine> cmdLine;
    	RDebug::Print(_L("3"));
    	 iLog.Write(_L("3"));
    	_LIT(KSeparator, "*");
    	RDebug::Print(_L("4"));
    	 iLog.Write(_L("4"));
    	// cmd line syntax: PortNumber*MIDletUid*MIDletName*JarLocation*JadLocation*
    
    	cmdLine.AppendNum(KMidletPort);
    	RDebug::Print(_L("5"));
    		 iLog.Write(_L("5"));
    	cmdLine.Append(KSeparator);
    	RDebug::Print(_L("6"));
    		 iLog.Write(_L("6"));
    	// append a midlet uid in decimal format to the command line
    	TBuf<16> uidNum;
    	RDebug::Print(_L("7"));
    		 iLog.Write(_L("7"));
    	uidNum.Num(KMidletUid.iUid,EDecimal);
    	RDebug::Print(_L("8"));
    		 iLog.Write(_L("8"));
    	cmdLine.Append(uidNum);
    	RDebug::Print(_L("9"));
    		 iLog.Write(_L("9"));
    	cmdLine.Append(KSeparator);
    	RDebug::Print(_L("10"));
    		 iLog.Write(_L("10"));
    	// append a midlet name to the command line
    	cmdLine.Append(KMidletName);
    	RDebug::Print(_L("11"));
    		 iLog.Write(_L("11"));
    	cmdLine.Append(KSeparator);
    	RDebug::Print(_L("12"));
    		 iLog.Write(_L("12"));
    	// append a jar file location to the command line
    	cmdLine.Append(KMidletJarLocation);
    	RDebug::Print(_L("13"));
    		 iLog.Write(_L("13"));
    	cmdLine.Append(KSeparator);
    	RDebug::Print(_L("14"));
    		 iLog.Write(_L("14"));
    	// append a jad file location to the command line
    	cmdLine.Append(KMidletJadLocation);
    	RDebug::Print(_L("15"));
    		 iLog.Write(_L("15"));
    	cmdLine.Append(KSeparator);
    	RDebug::Print(_L("16"));
    		 iLog.Write(_L("16"));
    	
    	// create a new process
    	RProcess process;
    	RDebug::Print(_L("17"));
    		 iLog.Write(_L("17"));
    	TInt error = process.Create(KMidRunROMLocation,cmdLine);
    	RDebug::Print(_L("18"));
    		 iLog.Write(_L("18"));
    	//User::LeaveIfError(error);
    		 iLog.WriteFormat(_L("------------>ERROR CODE =%d"),error);
    	RDebug::Print(_L("19"));
    		 iLog.Write(_L("19"));
    	// TODO: process should be renamed according to convention used with KVM
    
    
    	process.Resume();
    	RDebug::Print(_L("20"));
    		 iLog.Write(_L("20"));
    	process.Close();
    	RDebug::Print(_L("21"));
    		 iLog.Write(_L("21"));
    	CleanupStack::PopAndDestroy();//apasession
    	
    	iLog.Write(_L("--------------------- > ending launch midlet"));
    	RDebug::Print(_L(" --------------------- > ending launch midlet"));
    	
    }
    
    // ============================ MEMBER FUNCTIONS ===============================
    
    
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::ConstructL()
    // Symbian 2nd phase constructor can leave.
    // -----------------------------------------------------------------------------
    //
    void CMidletLaunchGUIAppUi::ConstructL() {
    	// Initialise app UI with standard value.
    	BaseConstructL(CAknAppUi::EAknEnableSkin);
    
    	
    	
    	
    	//initialise file logging
    	
    	iLog.Connect();
    	iLog.CreateLog(_L("Mylogs"),_L("Mllog.txt"),EFileLoggingModeOverwrite);
    	
    	
    	
    	
    	// Create view object
    	iAppView = CMidletLaunchGUIAppView::NewL(ClientRect() );
    
    	
    	
    
    	
    	
    	FindMidletUIDL();
    	RDebug::Print(_L("afterFindMidletUIDL"));
    	LaunchMidletL();
    }
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::CMidletLaunchGUIAppUi()
    // C++ default constructor can NOT contain any code, that might leave.
    // -----------------------------------------------------------------------------
    //
    CMidletLaunchGUIAppUi::CMidletLaunchGUIAppUi() {
    	// No implementation required
    }
    
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::~CMidletLaunchGUIAppUi()
    // Destructor.
    // -----------------------------------------------------------------------------
    //
    CMidletLaunchGUIAppUi::~CMidletLaunchGUIAppUi() {
    	if (iAppView) {
    		delete iAppView;
    		iAppView = NULL;
    	}
    
    	
    
    	// Close the log file and the connection to the server.
    	iLog.CloseLog();
    	iLog.Close();
    	
    }
    
    // -----------------------------------------------------------------------------
    // CMidletLaunchGUIAppUi::HandleCommandL()
    // Takes care of command handling.
    // -----------------------------------------------------------------------------
    //
    void CMidletLaunchGUIAppUi::HandleCommandL(TInt aCommand) {
    	switch (aCommand) {
    		case EEikCmdExit:
    		case EAknSoftkeyExit:
    			Exit();
    			break;
    
    		case ECommand1: {
    
    			// Load a string from the resource file and display it
    			HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT);
    			CAknInformationNote* informationNote;
    
    			informationNote = new ( ELeave ) CAknInformationNote;
    
    			// Show the information Note with
    			// textResource loaded with StringLoader.
    			informationNote->ExecuteLD( *textResource);
    
    			// Pop HBuf from CleanUpStack and Destroy it.
    			CleanupStack::PopAndDestroy(textResource);
    		}
    			break;
    		case ECommand2: {
    			
    			// Load a string from the resource file and display it
    			HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT);
    			CAknInformationNote* informationNote;
    
    			informationNote = new ( ELeave ) CAknInformationNote;
    
    			// Show the information Note with
    			// textResource loaded with StringLoader.
    			informationNote->ExecuteLD( *textResource);
    
    			// Pop HBuf from CleanUpStack and Destroy it.
    			CleanupStack::PopAndDestroy(textResource);
    			
    			
    		}
    			break;
    		case EHelp: {
    
    			CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
    			HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
    		}
    			break;
    		case EAbout: {
    
    			CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
    			dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
    			HBufC* title = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TITLE);
    			dlg->QueryHeading()->SetTextL(*title);
    			CleanupStack::PopAndDestroy(); //title
    			HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
    			dlg->SetMessageTextL(*msg);
    			CleanupStack::PopAndDestroy(); //msg
    			dlg->RunLD();
    		}
    			break;
    		default:
    			Panic(EMidletLaunchGUIUi);
    			break;
    	}
    }
    
    
    // End of File



    It seems the problem is now in LaunchMidletL()

    As you can see I am logging step by step to a file on the device. In my log file the line

    iLog.WriteFormat(_L("------------>ERROR CODE =%d"),error);


    prints -1 which is supposedly a KErrNotFound returned by
    TInt error = process.Create(KMidRunROMLocation,cmdLine);

    In the log file I can see that iLog.Write(_L("19")); occurs correctly but the application crashes right after supposedly on

    process.Resume();


    On the device the Panic raised is a KERN EXEC-0


    I have no idea why it is behaving so ...
    I don't know what is missing ... but I know I'm not very far.

    Do you guys have an idea ?


    Thanks again for helping me so much !
    Last edited by azpublic; 2008-11-21 at 13:01.

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Midlet Launcher C++ application silently dies on device

    at least there can not be executables in the "z:\\system\\programs\\" path you have defined, so you get -1 saying that it is not found. Then the process is not created, and using the process variable tells you that by raising the Kern Exec 0 panic.

  9. #9
    Registered User
    Join Date
    Jan 2008
    Posts
    22

    Re: Midlet Launcher C++ application silently dies on device

    Well the funny thing is tha midlet gets launched but right after launching the C++ app is killed !

    So I guess that "z:\\system\\programs\\kmidrun.exe" does exist after all ...

    No ?

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Midlet Launcher C++ application silently dies on device

    Starting from 3rd edition executables are only run from sys folder, so I would not think that the file exists, in my E71 even the programs folder is not there.

  11. #11
    Registered User
    Join Date
    Jan 2008
    Posts
    22

    Re: Midlet Launcher C++ application silently dies on device

    Ok so I've been reading this hilarious post that does pretty much the same thing I wanted to achieve

    http://discussion.forum.nokia.com/fo...d.php?t=135580

    and it seems that the line
    apaSession.StartDocument(_L(""), KMidletUid, threadId);

    was enough to start the midlet.

    I was sure it was the line :

    TInt error = process.Create(KMidRunROMLocation,cmdLine);

    that did it ... I just suppressed it and all the cmdLine variable construction as well ...

    and now it works perfectly !

    I wonder what process.Create(KMidRunROMLocation,cmdLine); was supposed to do in the first place.

    Thank you all for helping me.

Similar Threads

  1. Replies: 1
    Last Post: 2008-05-08, 12:32
  2. Replies: 5
    Last Post: 2008-03-10, 09:22
  3. WLAN Connection from Emulator
    By capri07 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2007-12-13, 05:13
  4. 技术文档:MIDP 2.0安全机制 与 MIDlet 数字签名
    By wotrust in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 0
    Last Post: 2006-12-30, 07:42
  5. Replies: 0
    Last Post: 2006-06-08, 09:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •