×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Seattle, US
    Posts
    145

    Unhappy CAknForm (newbie problem)

    I have a basic problem with CAknForm. I seem to do everything right, but for some reason when I invoke the form then it crashes the emualtor . Can anyone tell what's wrong here?

    Following is my code.

    Sources:

    Code:
    class CMyForm : public CAknForm
        {
        public:  // Constructor and destructor  
            /**
            * NewL
            * Two-phased constructor.
            */
            static CMyForm* NewL();
     
            /**
            * ~CMyForm
            * Destructor.
            */
            virtual ~CMyForm();
     
        private:  // Constructor
            /**
            * CMyForm
            * Default constructor.
            */
            CMyForm();
     
            /**
            * ConstructL
            * Second-phase constructor.
            */
            void ConstructL();
     };
    Header:

    Code:
    #include "MyForm.h"
    
    CMyForm * CMyForm ::NewL()
    	{
    	CMyForm * self = new (ELeave) CMyForm ();
    	CleanupStack::PushL(self);
    	self->ConstructL();
    	CleanupStack::Pop(self);
    	return self;
    	}
    
    CMyForm::CMyForm()
    	{
    	
    	}
    
    CMyForm::~CMyForm()
    	{
    	
    	}
    
    void CMyForm::ConstructL()
    	{
    	CAknForm::ConstructL();
    	}

    Resource file:
    Code:
    RESOURCE DIALOG r_myform_form_dialog
    {
    	flags = EEikDialogFlagNoDrag | 
    			EEikDialogFlagFillAppClientRect |
    			EEikDialogFlagWait; //|
    			//EEikDialogFlagCbaButtons;
    			
    	//buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    	form = r_myform_form;
    	
    	
    }
    
    // r_myform_form is defined as :
     
    RESOURCE FORM r_myform_form
    	{
    	//flags =  EEikFormUseDoubleSpacedFormat ;
    	items =
    		{
    		DLG_LINE
    			{
    			type=EEikCtEdwin;
    			prompt="NAME_TEXT";
    			id=7777;
    			itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
    			control=EDWIN 
    				{
    				width=50; 
    				maxlength=50;
    				};
    			}
    		};
    	}
    In my app UI file I invoke it like:

    Code:
    			CMyForm* form = CMyForm::NewL();
    			form->ExecuteLD(R_MYFORM_FORM);

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: CAknForm (newbie problem)

    Hi,

    When the emulator is crashing it is obviously giving the panic code.
    Please provide that panic code show that some one can identify the problem.

    Regards,
    Kavit.

  3. #3
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Seattle, US
    Posts
    145

    Re: CAknForm (newbie problem)

    Quote Originally Posted by Kavit Patel View Post
    Hi,

    When the emulator is crashing it is obviously giving the panic code.
    Please provide that panic code show that some one can identify the problem.

    Regards,
    Kavit.

    Hi Kavit,

    Sorry, but can you tell from where can I find that error code? The emulator just crashes and closes down.

    I tried to trap my call to ExecuteLD inside a TRAPD macro, but again the app emulator crashed and closed, and I couldn't get to see the panic code. Maybe I'm missing something here.

    Thanks.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: CAknForm (newbie problem)

    When the application is crashing it is exiting with displaying panic code in emulator screen. If your emulator is crashing and closed then you can also check your IDE's console log.

    Also one thing I can see, why you commented the "buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;"? Problem also may belongs to this.

    Regards,
    Kavit.

  5. #5
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: CAknForm (newbie problem)


  6. #6
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: CAknForm (newbie problem)

    And also note that
    Code:
    form->ExecuteLD(R_MYFORM_FORM_DIALOG);
    Since it expects a Dialog resource..Otherwise Bafl 15 panic occurs if i am not wrong..

  7. #7
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Seattle, US
    Posts
    145

    Re: CAknForm (newbie problem)

    That worked perfectly!! It was such a subtle error.

    Here is a screenshot of the "Extended Panic Code", but I still don't see the panic code upon crash. Can you tell why I don't get the panic code?

    Oops..don't know how to attach the snap. The problem is that the emulator crashes and it doesn't show any message.

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: CAknForm (newbie problem)

    If the emulator crashes, chances that you are executing your application directly, and not the emulator. Check http://wiki.forum.nokia.com/index.ph...arbide.c%2B%2B
    Also note that the error message may still appear in the console output window of the debugger (if you are debugging), and it may be also there in the logfile (http://wiki.forum.nokia.com/index.php/Epocwind.out), even when you are not debugging.

  9. #9
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Seattle, US
    Posts
    145

    Re: CAknForm (newbie problem)

    Thanks wizard_hu_, I wasn't running it in the emulator, this is why it was crashing. Now I get the panic code.

    Thanks.

Similar Threads

  1. Newbie problem opening form based on resource identifier
    By dunff2k in forum Symbian User Interface
    Replies: 8
    Last Post: 2008-09-22, 11:46
  2. NewBie link error creating CAknForm
    By sailesh_dit in forum Symbian
    Replies: 7
    Last Post: 2006-12-17, 18:01
  3. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  4. Newbie problem in J2ME
    By Iman in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2003-04-01, 09:55
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

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