• 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

    • Until EVs get solid state batteries that can last 800miles+ on a single charge in Canada's -50°C weather, all while functioning 100% offline, they're still just at a guineapig testing stage IMO, and simply not worth purchasing...
    • I would question if Neowin really needs science research studies/stories than.
    • Microsoft reveals Mu, an on-device small language model built into Windows 11 by Pradeep Viswanathan Last year, Microsoft revealed Copilot+ PCs featuring a dedicated Neural Processing Unit (NPU) capable of over 40 TOPS or more. These Copilot+ PCs came with Phi-Silica, an on-device SLM to bring language intelligence capabilities to Microsoft's own first-party apps and apps from other 3rd-party developers. Today, Microsoft revealed Mu, a new on-device small language model built into Windows 11. Microsoft's goal was to create an AI-powered agent within the Settings app that can understand a user's natural language queries and integrate it into the existing search box for a smooth user experience. Hence, Microsoft is using the new Mu model to power the new agent feature in the Settings app, which was made available to Windows Insiders recently in the Dev Channel with Copilot+ PCs. Like Phi-Silica, Mu is designed to operate efficiently on NPUs, delivering over 100 tokens per second while running locally. In the official blog post, Microsoft explained how they designed and trained the Mu language model. Here's an overview of the Mu language model: Mu is a 330M encoder-decoder language model. The encoder-decoder approach achieved about 47% lower first-token latency and 4.7× higher decoding speed compared to a decoder-only model of similar size. Mu uses weight sharing in certain components to reduce the total parameter count. Microsoft trained Mu using NVIDIA A100 GPUs on Azure Machine Learning. Mu is nearly comparable in performance to a similarly fine-tuned Phi-3.5-mini, despite being one-tenth of the size. The model is better suited for multi-word queries. So for short or partial-word inputs, the Settings app will continue to surface lexical and semantic search results in the search box. Interested users can download Windows 11 Build 26120.3964 (KB5058496) or higher to check out this new AI-powered agent in the Windows Settings app.
    • I work at a company that sends Samsung stuff to Best Buy, Costco, Amazon, and others, we are about to killed after this event.
    • only using AI for science research studies/stories like this which are somewhat separate from our main tech/IT-focused articles, it is like a separate column, sort of like the software stories. Also I believe plenty of other sites use AI in some form of other, but we are also honest enough to disclose it. Btw no that headline was completely me.
  • Recent Achievements

    • Dedicated
      tesla maxwell earned a badge
      Dedicated
    • Dedicated
      Camlann earned a badge
      Dedicated
    • Week One Done
      fredss earned a badge
      Week One Done
    • Dedicated
      fabioc earned a badge
      Dedicated
    • Week One Done
      GoForma earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      632
    2. 2
      Michael Scrip
      224
    3. 3
      ATLien_0
      219
    4. 4
      +FloatingFatMan
      142
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!