Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: to Run UNIX based EXE [MKS] through Shell in VC++ application Pin
kulkarniquiet12-May-08 17:00
kulkarniquiet12-May-08 17:00 
QuestionRe: to Run UNIX based EXE [MKS] through Shell in VC++ application Pin
David Crow13-May-08 3:35
David Crow13-May-08 3:35 
QuestionMenu item in Visual C++ greyed out and doesn't send command message Pin
Bluesray11-May-08 11:40
Bluesray11-May-08 11:40 
QuestionHow do I code Spin Control dialog button Pin
Kwanalouie11-May-08 9:08
Kwanalouie11-May-08 9:08 
AnswerRe: How do I code Spin Control dialog button Pin
JudyL_MD11-May-08 12:23
JudyL_MD11-May-08 12:23 
AnswerRe: How do I code Spin Control dialog button Pin
David Crow11-May-08 16:42
David Crow11-May-08 16:42 
QuestionProblem with Domodal overide behavior Pin
tom groezer11-May-08 8:25
tom groezer11-May-08 8:25 
AnswerRe: Problem with Domodal overide behavior Pin
Mark Salsbery11-May-08 11:10
Mark Salsbery11-May-08 11:10 
tom groezer wrote:
I'm waiting for this process to complete but that line is after DoModal after which the control is not going.


This really isn't going to work as designed.

If you insist on using a modal dialog, you'd have to poll for completion
from within the dialog class...not a very good design.

As with any other lengthy process, you should be waiting for completion on another
thread so you don't block the UI thread. If you need the UI to be in a modal state
until completion, there's a variety of ways to design the code. A couple examples:

1) Wrap the waiting worker thread in a modal dialog class. When the thread completes,
it can notify the dialog (with a posted message) and the dialog can close itself.

2) Disable the UI so the user can't do anything during the process (if necessary),
create a modeless dialog, and fire off the worker thread. When the thread completes,
it can notify the UI thread, at which time the UI thread can destroy the modeless dialog
and re-enable the UI.

However you design it, the main point is - blocking the UI thread for any lengthy
process (anything over a few seconds - some would say even less) is bad design, so
lengthy processes should be done on threads separate from the UI thread.


Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

AnswerRe: Problem with Domodal overide behavior Pin
Mark Salsbery11-May-08 12:11
Mark Salsbery11-May-08 12:11 
GeneralRe: Problem with Domodal overide behavior Pin
Nelek11-May-08 13:02
protectorNelek11-May-08 13:02 
GeneralRe: Problem with Domodal overide behavior Pin
tom groezer11-May-08 21:16
tom groezer11-May-08 21:16 
GeneralRe: Problem with Domodal overide behavior Pin
Mark Salsbery12-May-08 5:16
Mark Salsbery12-May-08 5:16 
QuestionProblem with Domodal overide behavior Pin
tom groezer11-May-08 8:24
tom groezer11-May-08 8:24 
AnswerRe: Problem with Domodal overide behavior Pin
Nelek11-May-08 13:01
protectorNelek11-May-08 13:01 
QuestionTPM in windows XP. Pin
Green Fuze11-May-08 4:09
Green Fuze11-May-08 4:09 
QuestionRe: TPM in windows XP. Pin
David Crow11-May-08 16:51
David Crow11-May-08 16:51 
AnswerRe: TPM in windows XP. Pin
Green Fuze12-May-08 0:21
Green Fuze12-May-08 0:21 
QuestionIs there any way to remove process from Task manager ? Pin
Yanshof11-May-08 2:45
Yanshof11-May-08 2:45 
AnswerRe: Is there any way to remove process from Task manager ? Pin
Hamid_RT11-May-08 4:26
Hamid_RT11-May-08 4:26 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Yanshof11-May-08 4:33
Yanshof11-May-08 4:33 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Hamid_RT11-May-08 5:07
Hamid_RT11-May-08 5:07 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Yanshof11-May-08 18:42
Yanshof11-May-08 18:42 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Hamid_RT11-May-08 19:04
Hamid_RT11-May-08 19:04 
AnswerRe: Is there any way to remove process from Task manager ? Pin
Maximilien11-May-08 5:03
Maximilien11-May-08 5:03 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Yanshof11-May-08 18:41
Yanshof11-May-08 18:41 

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.