• 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.
  • Posts

    • Unbelievably good deal sees this AMD Ryzen Windows 11 Lenovo laptop selling for just $266 by Sayan Sen While desktops are generally more powerful, laptops can be quite handy as they offer portability while also providing about 70-80% of the performance of a similar-priced desktop. If you are in the market shopping for one, then Lenovo is offering one with AMD's Ryzen 8-core APU at a low price of just $266 (purchase link down below). The discounted model we are specifically talking about here is the Lenovo IdeaPad 3 15ALC6., It is a 15.6-inch notebook powered by the AMD Ryzen 5700U APU, built on an 8-core 16-thread Zen 2 CPU and Vega 8 integrated graphics. The device has plenty of memory too, as it packs 12 GB of DDR4-3200 memory where 4 Gigs are soldered while the remaining 8 GB SODIMM is upgradable. Since the memory configuration is asymmetrical, the laptop likely supports flex mode and thus 8 out of 12 GB should be running in dual channel mode while the remaining 4 is in single channel mode. The laptop has a 512 GB M.2 2242 SSD for storage. Get it at the link below: Lenovo 2023 Ideapad 15.6 Inch FHD Touchscreen, 12GB RAM, 512GB SSD, Wi-Fi 6, Bluetooth 5, Windows 11 Home: $265.70 (Shipped and Sold by Amazon US) You may notice the poor reviews for this laptop on Amazon but that is apparently due to a possibly fraudulent seller. This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • This is obviously the most buggy web browser.
    • Uhm, why the preferential treatment for 1Password instead of simply providing an API for all password managers to plug into? I ditched 1Password for Enpass soon as Agilebits began forcing their cloud sh*t into 1Password. Have no reason to switch from the 100% locally-hosted Enpass...
    • I don't know when it'll happen but the jump in the Canary builds indicate to me we're getting closer. I think if we're going to see anything about a Win12 it'll be with builds 28000 and up.
  • Recent Achievements

    • Week One Done
      emptyother earned a badge
      Week One Done
    • Week One Done
      DarkWun earned a badge
      Week One Done
    • Very Popular
      valkyr09 earned a badge
      Very Popular
    • Week One Done
      suprememobiles earned a badge
      Week One Done
    • Week One Done
      Marites earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      566
    2. 2
      +FloatingFatMan
      178
    3. 3
      ATLien_0
      177
    4. 4
      Xenon
      119
    5. 5
      Som
      112
  • Tell a friend

    Love Neowin? Tell a friend!