Solved

Using CProgressCtrl and a Cancel Button

Posted on 1999-01-20
1
255 Views
Last Modified: 2013-11-20
I am trying to create a dialog that is very similar to a standard windows progress dialog.  On my dialog, I have a cancel button.  How can I perform a continuous action upon opening the dialog until the user presses the cancel button?  I have tried using PeekMessage but can't seem to get the application to Yield.  I currently have a processing loop in the Timer so that I can start the timer after the dialog is initialized and displayed.  Is there somewhere else I should be doing the processing?  How do I allow the cancel button to be pressed while in my processing loop and then detect that it was pressed?  Thanks in advance for any input!
0
Comment
Question by:selen
1 Comment
 
LVL 3

Accepted Solution

by:
luisr earned 100 total points
ID: 1328062
Some time ago I developed a little framework for doing this. I never released it, but I'm willing to share it to you. Send e-mail to me at luisr@iname.com if you are interested.

The way it works is that you create the dialog on the main thread and creates a new thread for the code that can be canceled. It's very simple to use.

I think this little framework is exactly what you need.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now