Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6596223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:02:50+00:00 2026-05-25T18:02:50+00:00

I have a simple CMFCRibbonProgressBar and a thread that calls SetPos(value, TRUE) on it

  • 0

I have a simple CMFCRibbonProgressBar and a thread that calls SetPos(value, TRUE) on it when a lengthy operation progresses.
The problem is that in debug mode it asserts in wincore.cpp with this:

    CHandleMap* pMap = afxMapHWND();
    ASSERT(pMap != NULL);

I understand by the comments in that file that I shouldn’t be calling it from a different thread because it could potentially be dangerous.
My question then is how do you get a thread to update the position of the progress bar ?
I’m very tempted to just ignore that assert and continue in release mode but that’s pretty evil…

Any suggestions ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:02:50+00:00Added an answer on May 25, 2026 at 6:02 pm

    Ok, someone commented very briefly on the question and they had the right answer. I don’t know why they retracted their comment :/

    I ended up storing a CWnd* pointer in the CMFCRibbonProgressBar derived class, and whenever I call the “SetAmountCompleted” method from the worker thread, I use the CWnd to send a custom message with a pointer to the derived class in the WPARAM.
    The CWnd that receives the message then extracts the pointer and calls Update method which will redraw the progress bar.

    It’s complicated, it’s ugly, it’s MFC. Phew.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple WinForms application where modifying Windows Registry. The problem is that in
I have simple win service, that executes few tasks periodically. How should I pass
I have simple template that's html mostly and then pulls some stuff out of
I have simple JavaScript code that is using the Ajax API for fetching a
I have simple table that has about 80 rows, which I populate dynamically using
I have simple code: <?php error_reporting(E_ALL); ini_set('display_errors', true); ini_set('html_errors', false); $test = array(); $test
i have simple QStandardItemModel that holds the date to show in QTreeview when i
I have simple aspx page that has a form and a input field in
I have simple button: <button type=button id=somebutton value=start>blah</button> in jQuery, on the bind('click, function(){....
I have simple login form in my website. In given requirements stands, that password

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.