Click here to Skip to main content
15,912,021 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralInitializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 15:39
valikac15-Apr-02 15:39 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 15:59
Diarrhio15-Apr-02 15:59 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:03
valikac15-Apr-02 16:03 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 16:17
Diarrhio15-Apr-02 16:17 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:24
valikac15-Apr-02 16:24 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 16:48
Diarrhio15-Apr-02 16:48 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:58
valikac15-Apr-02 16:58 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 17:08
Diarrhio15-Apr-02 17:08 
Yes. There are a number of ways to do this, and most depend on the nature of the work you are computing.

The best choice would be to create a worker thread to accomplish the task you want to process, and if they cancel key gets pressed, just kill the thread. This will allow your UI to still be responsive while the task is being completed. But threading is tricky, and it sounds like you are newer to MFC and possibly C++.

Another possibility is avoiding creating your own dialog and just use one like Chris Maunder's found here: http://www.codeproject.com/miscctrl/progresswnd.asp

This is the simplest approach, but it isn't multi-threaded, and thus, your program will seem unresponsive until the point in your loop where you check to see if the cancel button was pressed. Then all you have to do is just break out of whatever loop you are using to do your work.

D
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 17:30
valikac15-Apr-02 17:30 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 18:04
valikac15-Apr-02 18:04 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 18:50
Diarrhio15-Apr-02 18:50 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 18:48
Diarrhio15-Apr-02 18:48 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac16-Apr-02 4:50
valikac16-Apr-02 4:50 
GeneralRe: Before or After Pin
valikac16-Apr-02 12:46
valikac16-Apr-02 12:46 
GeneralBitBlt problem Pin
Jack Handy15-Apr-02 15:26
Jack Handy15-Apr-02 15:26 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 18:51
mentorPaul M Watt15-Apr-02 18:51 
GeneralRe: BitBlt problem Pin
Jack Handy15-Apr-02 19:12
Jack Handy15-Apr-02 19:12 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 20:08
mentorPaul M Watt15-Apr-02 20:08 
GeneralRe: BitBlt problem Pin
Jack Handy15-Apr-02 21:20
Jack Handy15-Apr-02 21:20 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 21:33
mentorPaul M Watt15-Apr-02 21:33 
Generallinker error cant find mfc42u.lib Pin
15-Apr-02 15:15
suss15-Apr-02 15:15 
GeneralRe: linker error cant find mfc42u.lib Pin
Matt Newman15-Apr-02 15:25
Matt Newman15-Apr-02 15:25 
GeneralRe: linker error cant find mfc42u.lib Pin
15-Apr-02 15:40
suss15-Apr-02 15:40 
GeneralUnderstanding The Future of MFC Pin
valikac15-Apr-02 14:56
valikac15-Apr-02 14:56 
GeneralRe: Understanding The Future of MFC Pin
Matt Newman15-Apr-02 15:28
Matt Newman15-Apr-02 15:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.