Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Using CAknWaitDialog without callback

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: rathodavinash (03 May 2007)
Last edited: hamishwillee (30 May 2013)

The following article describes how to use a CAknWaitDialog without using callbacks. It shows how to create the wait dialog, how to handle the cancel button and how to do away with the dialog when the process has finished.

Header File (.h)

Declare CAknWaitDialog* iWaitDialog; in your class. There's no need to derive the class from MProgressDialogCallback.


Code (.cpp)

  • Creation and handling Cancel
iWaitDialog = new(ELeave)CAknWaitDialog( (REINTERPRET_CAST(CEikDialog**,&iWaitDialog)));//create instance
 
iWaitDialog->PrepareLC(R_MYWAITDIALOG);
iWaitDialog->SetTextL(_L("Connecting..."));
if(iWaitDialog->RunLD()==0)
{
//Cancel has been pressed iWaitDialog will be destroyed because of LD
}
/*
NOTE: If the dialog is used as a modal, only then RunLD returns 0 when the
dialog is dismissed and if the dialog is not used as a modal then it returns
EAknSoftkeyDone.
*/


  • Dismiss wait dialog (on the event that the process has finished)
void CMyClass::MyProcessIsOver()
{
if(iWaitDialog)
iWaitDialog->ProcessFinishedL();
}
This page was last modified on 30 May 2013, at 04:41.
24 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×