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.
Declare CAknWaitDialog* iWaitDialog; in your class. There's no need to derive the class from MProgressDialogCallback.
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.
*/
void CMyClass::MyProcessIsOver()
{
if(iWaitDialog)
iWaitDialog->ProcessFinishedL();
}