Hello everyone,
I developped an application for doing Http transaction. I use CAknWaitDialog to indicate the process status. When I tried to cancel the http transaction, the connection could be closed successfully. But the dialog could not be dismissed. The text in the dialog turns to "Application is busy". And I can do nothing to dismiss the dialog any more.
Here is my source code:
Here is the resource code for dialog:Code://Constructor, Defines priority for this Active object CTelObserver::CTelObserver(CHttpCommunication* aServerComm) : iServerComm(aServerComm) { } // Two phase construction CTelObserver* CTelObserver::NewL(CHttpCommunication* aServerComm) { CTelObserver* self = CTelObserver::NewLC(aServerComm); CleanupStack::Pop(self); return self; } CTelObserver* CTelObserver::NewLC(CHttpCommunication* aServerComm) { CTelObserver* self = new (ELeave) CTelObserver(aServerComm); CleanupStack::PushL(self); self->ConstructL(); return self; } void CTelObserver::ConstructL() { } // Destructor CTelObserver::~CTelObserver() { } // Start show waiting dialog void CTelObserver::StartWaiting() { if (iWaitNote) { delete iWaitNote; iWaitNote = NULL; } CAknWaitDialog* aWaitNote = new (ELeave) CAknWaitDialog( reinterpret_cast<CEikDialog**> (&iWaitNote), ETrue); CleanupStack::PushL(aWaitNote); aWaitNote->SetCallback(this); aWaitNote->PrepareLC(R_HTTP_REQUEST_WAIT_NOTE); CleanupStack::Pop(aWaitNote); iWaitNote = aWaitNote; iWaitNote->RunLD(); } // Change the text in dialog void CTelObserver::ChangeWaitNoteTextL(const TDesC& aDesC) { iWaitNote->SetTextL(aDesC); } // To dismiss wait note void CTelObserver::DismissWaitNote() { iWaitNote->ProcessFinishedL(); iWaitNote = NULL; } // From MProgressDialogCallback void CTelObserver::DialogDismissedL(TInt aButtonId) { iServerComm->Cancel(); iServerComm->CloseConnection(); }
Anyone has suggestions? I am really stuck.Code:RESOURCE DIALOG r_http_request_wait_note { flags = EAknWaitNoteFlags | EEikDialogFlagWait |EEikDialogFlagNotifyEsc; buttons=R_AVKON_SOFTKEYS_CANCEL; items = { DLG_LINE { type = EAknCtNote; id = ECidWaitNote; control = AVKON_NOTE { layout = EWaitLayout; singular_label = "Opening Connection.."; animation = R_QGN_GRAF_WAIT_BAR_ANIM; }; } }; }



