-
September 19th, 2012, 08:42 AM
#1
IPogressDialog
I am using an IProgressDialog object to reflect the progress during a long operation. Through experimentation, I've noticed that the Cancel button is not responsive if I pass a non-NULL handle as the parent to the progress dialog. And, if I try to move the dialog, it will not work. It doesn't matter if I use a marquee style or a stepped style. Here's some sample code...
Code:
UIProgressDialog ProgressDlg;
ProgressDlg.Init ();
ProgressDlg.SetTitle (_T("Sample Title"));
//xxxProgressDlg.StartProgressDialog (m_hWnd, UIProgressStyle::UIPS_Marquee);
ProgressDlg.StartProgressDialog (m_hWnd);
ProgressDlg.SetCancelMessage (_T("Cancelling..."));
ProgressDlg.SetLineText (1, _T("Line 1 of text"), FALSE);
ProgressDlg.SetLineText (2, _T("Line 2 of text"), FALSE);
ProgressDlg.SetLineText (3, _T("Line 3 of text"), FALSE);
for (int i=0; i<1000; i++)
{
CString msg;
if (ProgressDlg.HasUserCancelled()) break;
msg.Format ("I'm processing item %d", i);
ProgressDlg.SetLineText (2, msg, FALSE);
Sleep(50);
ProgressDlg.SetProgress(i, 1000);
}
ProgressDlg.StopProgressDialog ();
Is this by design? Is this a bug? Am I redirecting the progress dialog messaging by providing a handle to a parent dialog? The only way I can get it to work correctly, is to pass a NULL handle.
Gort...Klaatu, Barada Nikto!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|