×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    HandleResourceChange and WaitDialog

    Hi,

    In my application, when the device is rotated, I need to update my display.
    I'm doing that by overriding HandleResourceChange and calling my update from there.
    The update can take a little while, so I'm also showing a wait dialog (using ExecuteWaitDialog1LD) in HandleResourceChange.
    This works fine on most phones, but on some (N97 for example), the ExecuteWaitDialog1LD function causes HandleResourceChange to be called again, so I get an infinite loop till memory runs out.

    Why is this happening and how can I fix it (besides removing the wait dialog) ?

    Thanks,
    Ran

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

    Re: HandleResourceChange and WaitDialog

    Wait dialog should really not do that, anyway, is it Global wait note, or the normal one ?, globals would use their own window, thus causing focus event's for the app, that could cause problems..

  3. #3
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: HandleResourceChange and WaitDialog

    I think it's the normal wait dialog, I just dropped it from the "notes and dialogs" list in carbide UI designer.

    Thanks.

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

    Re: HandleResourceChange and WaitDialog

    I can not see why a normal wait dialog would do that, so can you check by disabling parts of code that if the wait dialog is actually the offending part..

  5. #5
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: HandleResourceChange and WaitDialog

    I did that - I commented the call to the ExecuteWaitDialog function and the problem was resolved.

    Maybe there is some workaround?

    Thanks.

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

    Re: HandleResourceChange and WaitDialog

    Dunno, since I don't know your logic there, so can you explain on what you do in the function, and how you are callign the wait dialog ?

  7. #7
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: HandleResourceChange and WaitDialog

    In the function I do an async call to the web to get an image to be displayed.
    Like I said before, it works fine if I remove the call to the wait dialog.
    I'm displaying the wait dialog with the generated function of the UI designer : ExecuteWaitDialog1LD

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

    Re: HandleResourceChange and WaitDialog

    How does it look in C++ code level, I actually never use the UI designer..

  9. #9
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: HandleResourceChange and WaitDialog

    Here are the generated functions for the Wait Dialog:

    Code:
    void CMyclass::ExecuteWaitDialog1LD( const TDesC* aOverrideText )
    	{
    	iWaitDialog1 = new ( ELeave ) CAknWaitDialog( 
    			reinterpret_cast< CEikDialog** >( &iWaitDialog1 ), EFalse );
    	if ( aOverrideText != NULL )
    		{
    		iWaitDialog1->SetTextL( *aOverrideText );
    		}
    	iWaitDialog1->ExecuteLD( R_WAIT_DIALOG2 );
    	}
    
    void CMyclass::RemoveWaitDialog1L()
    	{
    	if ( iWaitDialog1 != NULL )
    		{
    		iWaitDialog1->SetCallback( NULL );
    		iWaitDialog1->ProcessFinishedL();    // deletes the dialog
    		iWaitDialog1 = NULL;
    		}
    	}

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

    Re: HandleResourceChange and WaitDialog

    that looks pretty good, so what happens in HandleResourceChange ?

  11. #11
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: HandleResourceChange and WaitDialog

    In HandleResourceChange I call ExeucteWaitDialog1LD , and that causes HandleResourceChange to be called again and hence going into an infinite loop which results in "memory full" error.

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

    Re: HandleResourceChange and WaitDialog

    ok, what about, adding into the beginning of the ExeucteWaitDialog1LD a if clause that constructs the iWaitDialog1 only if it is NULL..

  13. #13
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: HandleResourceChange and WaitDialog

    Good idea, it's working. :-)
    Thanks!

Similar Threads

  1. HandleResourceChange is not being called
    By cabezonxdg in forum Symbian
    Replies: 9
    Last Post: 2011-05-20, 04:17
  2. HandleResourceChange crashing
    By vinayakak in forum Symbian
    Replies: 3
    Last Post: 2009-02-11, 04:40
  3. CAknMessageQueryDialog and HandleResourceChange
    By mrtj in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-11-07, 12:09
  4. Replies: 4
    Last Post: 2007-08-02, 11:06
  5. HandleResourceChange in AVKON_SETTING_PAGE
    By hong.lam in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-12-14, 03:51

Posting Permissions

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