×
Namespaces

Variants
Actions

Using CAknWaitDialog without callback

From Nokia Developer 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 07:41.
54 page views in the last 30 days.
×