×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605

    Application crashes after TRAPD

    I write the followinf statement.

    Code:
    TBuf<64>  message_status;
    	_LIT(KMessageStatus,"New Messages=%d");
    	message_status.Format(KMessageStatus,aMessageStatus);
    		
    	TRAPD(error,iAppView->UpdateL(EMessage,message_status));
    	if(error!=KErrNone)
    	{
    	_LIT(KBatUpdateFailed,"Bat Update Failed");
    	iEikonEnv->AlertWin(KBatUpdateFailed);
    	
    	}
    now when i m debugging, as the debugger returns after executing the methodUpdateL , the application crashes and message comes "Program closed" AppName ..

    just for the reference
    the code of iAppView->UpdateL and the case statement which gets executed
    Code:
    	_LIT(KTab,"\t");
    //	_LIT(KMark,"|\t");
    	HBufC* row;
    	row = PrependLC( KTab(), aStatus );
    	switch(aPos)
    	{
    		case EBat:
    		{
    		iListBoxRows->InsertL(aPos,row->Des());
    		 // Update listbox	
    		iListBox->HandleItemAdditionL();
    		// Set the item at index aPos 
    		iListBox->SetCurrentItemIndex(aPos);
    		// Set the list box control with a focus
    		 iListBox->SetFocus(ETrue);
    		break;
    		}
    Can someone throw some light on it ,

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    34
    Hi,

    what about temporary removing the TRAPD and debugging the applikation to get the actual line of the error?

    Regards
    Reinhard

  3. #3
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605
    Thnx Reinhard

    But i forgot to update this thread.Actualy i have traced the problem.I was leaving a object on cleanup stack and not removing it.
    TRAPD was catching it and hence the error.

    But one issue still remains ..
    Just see my thread of Panic Codes on same page.

Posting Permissions

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