• 0

MFC CProgressCtrl


Question

I'm trying to use a CProgressCtrl to monitor a file download. All the downloading stuff works properly. However....

About halfway through the download, the CProgressCtrl stops updating. The download continues to the end... and at the end, the control executes its final step and shows 100% as if it had been updating all along.

Errr... can anyone tell me why it DOESN'T update all along?

Here's the code I'm using.

void __stdcall DownloadInitializeFunc(CNativeStubDlg *dialog,unsigned int nContent,unsigned int nStep)
{
	dialog->m_Progress1.SetRange32(0,nContent);
	dialog->m_Progress1.SetStep(nStep);
}

void __stdcall DownloadProgressFunc(CNativeStubDlg *dialog)
{
	dialog->m_Progress1.StepIt();
}

This is Visual C++ 6.0, if that matters.

--

Danny Smurf

Link to comment
https://www.neowin.net/forum/topic/127537-mfc-cprogressctrl/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I was having the exact same problem until a week or two ago, when I posted my problem in the CodeProject forums and got this solution: "stop updating it so often". In my case, I was updating the status about 1000 times; I changed it to update only 50 times (approx. the max resolution my progress control can display), and now it works almost perfectly :).

  • 0
  IGx89 said:
I was having the exact same problem until a week or two ago, when I posted my problem in the CodeProject forums and got this solution: "stop updating it so often". In my case, I was updating the status about 1000 times; I changed it to update only 50 times (approx. the max resolution my progress control can display), and now it works almost perfectly :).

Nope, no joy. Changed it to 100 (so that it updates as a percent complete instead of by number of bytes). Exact same result.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.