Click here to Skip to main content
15,888,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: what is "wofstream" useful for?!! Pin
Aescleal3-Aug-10 22:05
Aescleal3-Aug-10 22:05 
GeneralRe: what is "wofstream" useful for?!! Pin
Joseph Marzbani3-Aug-10 22:53
Joseph Marzbani3-Aug-10 22:53 
GeneralRe: what is "wofstream" useful for?!! Pin
Richard MacCutchan4-Aug-10 3:26
mveRichard MacCutchan4-Aug-10 3:26 
QuestionTooltips can't be shown Pin
gaspher3-Aug-10 2:47
gaspher3-Aug-10 2:47 
QuestionRe: Tooltips can't be shown Pin
David Crow3-Aug-10 3:18
David Crow3-Aug-10 3:18 
AnswerRe: Tooltips can't be shown Pin
gaspher3-Aug-10 3:37
gaspher3-Aug-10 3:37 
GeneralRe: Tooltips can't be shown Pin
David Crow3-Aug-10 3:43
David Crow3-Aug-10 3:43 
QuestionHandling Abort for Long running operations in MFC Pin
MuraliKrishnaP3-Aug-10 0:54
MuraliKrishnaP3-Aug-10 0:54 
I am trying to find an easier way to handle Abort mechanism for long running operations. I tried googling all CP articles but, still I can't find a better way to solve my problem. My application has huge code base. I have to carefully design the Abort functionality without making major changes to existing code. I want the future programmers to understand and debug the code easily. Adding more complexity, the application creates GUI / Glyphs on the fly.

Here are some solutions I found on CP:
1. Using PeekMessage loop and PumpMessage during long running operations. - Not feasible for huge apps, not easy to debug. Abort will be on and off.
2. Using worker thread for long operations, main thread becomes free, post completion status to main thread after completing long operation. - Gives most responsive app but, needs redesign of total code, exception handling will be difficult.
3. Using worker thread for creating glyphs, performing long operations and all from one single Worker Proc. - Not at all recommended. Window handles cannot be easily used from other threads without using CWnd::FromHandle() or Attach() methods. If there are any SendMessage() calls, it will lead to lead locks.
4. Using UIThread. - Will show an awkward Abort dialog every time but, solves problem very simply without having to change major code. There are other problems, The UIThread Abort dialog shows as seperate task bar button. This can be made as part of main app by making it tool window or by creating hidden window as parent. But, as the main window is busy, showing UIThread dialog when main thread is busy is something I need to solve.

I read one article: http://www.drdobbs.com/184416859[^] but can't understand the way to make it work. I request you people to take a look. In this, the author creates a new UIThread and the InitInstance waits until the long operation is done. I can't understand how this makes the main thread responsive. I tried it and it didn't work.

As you can understand, I am seeing all combinations. The Dr Dobbs article showed hope initially but did not work for me. Please guide me with your experience.

Thanks,
Murali Krishna.
AnswerRe: Handling Abort for Long running operations in MFC Pin
Aescleal3-Aug-10 1:10
Aescleal3-Aug-10 1:10 
GeneralRe: Handling Abort for Long running operations in MFC Pin
MuraliKrishnaP3-Aug-10 2:32
MuraliKrishnaP3-Aug-10 2:32 
GeneralRe: Handling Abort for Long running operations in MFC Pin
MuraliKrishnaP3-Aug-10 2:43
MuraliKrishnaP3-Aug-10 2:43 
GeneralRe: Handling Abort for Long running operations in MFC Pin
Aescleal3-Aug-10 5:31
Aescleal3-Aug-10 5:31 
GeneralRe: Handling Abort for Long running operations in MFC Pin
MuraliKrishnaP6-Aug-10 10:03
MuraliKrishnaP6-Aug-10 10:03 
AnswerRe: Handling Abort for Long running operations in MFC Pin
«_Superman_»3-Aug-10 15:57
professional«_Superman_»3-Aug-10 15:57 
Questionproblem using ShellExecute to open folder Pin
Rahul Vaishnav2-Aug-10 23:51
Rahul Vaishnav2-Aug-10 23:51 
AnswerRe: problem using ShellExecute to open folder PinPopular
enhzflep3-Aug-10 0:10
enhzflep3-Aug-10 0:10 
GeneralRe: problem using ShellExecute to open folder Pin
Rahul Vaishnav3-Aug-10 0:14
Rahul Vaishnav3-Aug-10 0:14 
AnswerRe: problem using ShellExecute to open folder Pin
Shivanand Gupta5-Aug-10 1:09
Shivanand Gupta5-Aug-10 1:09 
QuestionThis application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
reza toorani2-Aug-10 22:52
reza toorani2-Aug-10 22:52 
AnswerRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Cedric Moonen2-Aug-10 22:54
Cedric Moonen2-Aug-10 22:54 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
reza toorani2-Aug-10 23:48
reza toorani2-Aug-10 23:48 
AnswerRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
KarstenK3-Aug-10 0:09
mveKarstenK3-Aug-10 0:09 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
reza toorani3-Aug-10 0:28
reza toorani3-Aug-10 0:28 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
KarstenK3-Aug-10 0:36
mveKarstenK3-Aug-10 0:36 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
reza toorani3-Aug-10 1:08
reza toorani3-Aug-10 1:08 

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.