Click here to Skip to main content
15,908,264 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Should I migrate from Visual C++ 6 to Visual C++ 2005 Pin
#realJSOP8-Feb-07 23:29
professional#realJSOP8-Feb-07 23:29 
AnswerRe: Should I migrate from Visual C++ 6 to Visual C++ 2005 Pin
Wei Cheng9-Feb-07 3:02
Wei Cheng9-Feb-07 3:02 
QuestionDialog box from UI thread crashes application Pin
BuckBrown8-Feb-07 10:43
BuckBrown8-Feb-07 10:43 
AnswerRe: Dialog box from UI thread crashes application Pin
Mark Salsbery8-Feb-07 11:28
Mark Salsbery8-Feb-07 11:28 
GeneralRe: Dialog box from UI thread crashes application Pin
BuckBrown8-Feb-07 12:05
BuckBrown8-Feb-07 12:05 
GeneralRe: Dialog box from UI thread crashes application Pin
Mark Salsbery8-Feb-07 12:24
Mark Salsbery8-Feb-07 12:24 
GeneralRe: Dialog box from UI thread crashes application Pin
BuckBrown8-Feb-07 12:35
BuckBrown8-Feb-07 12:35 
GeneralRe: Dialog box from UI thread crashes application Pin
Mark Salsbery8-Feb-07 12:52
Mark Salsbery8-Feb-07 12:52 
BuckBrown wrote:
Let me say that I am NOT a Windows programmer


Smile | :) Too late - you're a windows programmer.

I prefer 1 UI thread (the CWinApp one in MFC).
So, I would
1) respond to the button click
2) create/show a modeless progress dialog
3) disable the main window if appropriate or at least the button so the user can't click it again
4) start a worker thread which executes the test code
4a)The worker thread could periodically post messages to the modeless dialog to indicate progress
(if that info is available) - this could be done via class method as well but then you may have
to handle thread synchronization.
5) If the user clicks cancel (if provided in the modeless dialog) then somehow inform the thread
to terminate - using a flag variable or event object.
6) If the test thread ends normally then it could post a message to the main window or the dialog
(whichever is appropriate) indicating completion.
7) on receipt of the completion message, destroy/cleanup the thread object, the modeless dialog,
and reanable any disabled windows from step 3

Something like that.

Mark
GeneralRe: Dialog box from UI thread crashes application Pin
BuckBrown8-Feb-07 13:02
BuckBrown8-Feb-07 13:02 
GeneralRe: Dialog box from UI thread crashes application Pin
BuckBrown8-Feb-07 13:51
BuckBrown8-Feb-07 13:51 
GeneralRe: Dialog box from UI thread crashes application Pin
Mark Salsbery8-Feb-07 13:53
Mark Salsbery8-Feb-07 13:53 
GeneralRe: Dialog box from UI thread crashes application Pin
Mark Salsbery8-Feb-07 13:55
Mark Salsbery8-Feb-07 13:55 
GeneralRe: Dialog box from UI thread crashes application Pin
Mark Salsbery8-Feb-07 13:57
Mark Salsbery8-Feb-07 13:57 
AnswerRe: Dialog box from UI thread crashes application Pin
Ravi Bhavnani8-Feb-07 14:29
professionalRavi Bhavnani8-Feb-07 14:29 
QuestionUniversal Bluetooth API / SDKs Pin
Obliterator8-Feb-07 9:22
Obliterator8-Feb-07 9:22 
AnswerRe: Universal Bluetooth API / SDKs Pin
Cedric Moonen8-Feb-07 9:54
Cedric Moonen8-Feb-07 9:54 
GeneralRe: Universal Bluetooth API / SDKs Pin
Obliterator9-Feb-07 3:37
Obliterator9-Feb-07 3:37 
QuestionWinsock send FiFo Size Pin
ScotDolan8-Feb-07 9:09
ScotDolan8-Feb-07 9:09 
AnswerRe: Winsock send FiFo Size [modified] Pin
Mark Salsbery8-Feb-07 9:51
Mark Salsbery8-Feb-07 9:51 
AnswerRe: Winsock send FiFo Size Pin
Mark Salsbery8-Feb-07 9:54
Mark Salsbery8-Feb-07 9:54 
GeneralRe: Winsock send FiFo Size Pin
ScotDolan8-Feb-07 10:44
ScotDolan8-Feb-07 10:44 
GeneralRe: Winsock send FiFo Size Pin
Mark Salsbery8-Feb-07 11:04
Mark Salsbery8-Feb-07 11:04 
GeneralRe: Winsock send FiFo Size Pin
ScotDolan8-Feb-07 11:55
ScotDolan8-Feb-07 11:55 
GeneralRe: Winsock send FiFo Size Pin
Mark Salsbery8-Feb-07 13:30
Mark Salsbery8-Feb-07 13:30 
AnswerRe: Winsock send FiFo Size Pin
Jörgen Sigvardsson8-Feb-07 10:21
Jörgen Sigvardsson8-Feb-07 10:21 

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.