Click here to Skip to main content
15,906,626 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting ACL for floppy Pin
VC_RYK10-Apr-07 19:59
VC_RYK10-Apr-07 19:59 
GeneralRe: Setting ACL for floppy Pin
Mark Salsbery11-Apr-07 6:22
Mark Salsbery11-Apr-07 6:22 
GeneralRe: Setting ACL for floppy Pin
VC_RYK11-Apr-07 20:16
VC_RYK11-Apr-07 20:16 
QuestionList box with Jpg image perview. Pin
Sameer_Thakur10-Apr-07 0:58
Sameer_Thakur10-Apr-07 0:58 
AnswerRe: List box with Jpg image perview. Pin
Hamid_RT10-Apr-07 1:58
Hamid_RT10-Apr-07 1:58 
GeneralRe: List box with Jpg image perview. Pin
Sameer_Thakur10-Apr-07 2:11
Sameer_Thakur10-Apr-07 2:11 
GeneralRe: List box with Jpg image perview. Pin
Hamid_RT10-Apr-07 2:19
Hamid_RT10-Apr-07 2:19 
QuestionThread execution on button press suggestion Pin
J.B.10-Apr-07 0:56
J.B.10-Apr-07 0:56 
Hi all,
I am creating a dialog app that has a button. When the button is pressed, in OnButton function of the dialog's cpp it creates a thread (I am using CreateThread())that runs some task. I will have to wait for the task's completion by watching the thread's termination via WaitForSingleObject(hThread, INFINITE) there. Now, the thread 's execution may take seconds so the WaitForSingleObject() would actually block windows messages and the dialog window "freezes" during the time. I'd love to NOT have the dialog frozen but simply have the button disabled during the thread task's execution. As now I have two ways in mind:

1. Use Timer and places the thread creation process in the Timer's function instead. Disabling and re-enabling button can be directly done in the function.
2. Create a main thread that does the thread creation process. The main thread will disable and enable the button via PostMessage().

I am just wondering what an appropriate approach would be to solve this problem?

Thanks in advance,
Best Regards,
Johnny
AnswerRe: Thread execution on button press suggestion Pin
cp987610-Apr-07 1:25
cp987610-Apr-07 1:25 
GeneralRe: Thread execution on button press suggestion Pin
J.B.10-Apr-07 1:37
J.B.10-Apr-07 1:37 
AnswerRe: Thread execution on button press suggestion Pin
Roger Stoltz10-Apr-07 1:48
Roger Stoltz10-Apr-07 1:48 
GeneralRe: Thread execution on button press suggestion Pin
David Crow10-Apr-07 2:10
David Crow10-Apr-07 2:10 
GeneralRe: Thread execution on button press suggestion Pin
Stephen Hewitt10-Apr-07 17:52
Stephen Hewitt10-Apr-07 17:52 
GeneralRe: Thread execution on button press suggestion Pin
cp987610-Apr-07 2:18
cp987610-Apr-07 2:18 
GeneralRe: Thread execution on button press suggestion Pin
Stephen Hewitt10-Apr-07 17:49
Stephen Hewitt10-Apr-07 17:49 
GeneralRe: Thread execution on button press suggestion Pin
Roger Stoltz10-Apr-07 21:58
Roger Stoltz10-Apr-07 21:58 
GeneralRe: Thread execution on button press suggestion Pin
J.B.10-Apr-07 20:59
J.B.10-Apr-07 20:59 
GeneralRe: Thread execution on button press suggestion Pin
Roger Stoltz10-Apr-07 21:39
Roger Stoltz10-Apr-07 21:39 
GeneralRe: Thread execution on button press suggestion Pin
J.B.21-Apr-07 23:58
J.B.21-Apr-07 23:58 
GeneralRe: Thread execution on button press suggestion Pin
Roger Stoltz22-Apr-07 9:50
Roger Stoltz22-Apr-07 9:50 
AnswerRe: Thread execution on button press suggestion Pin
Stephen Hewitt10-Apr-07 17:43
Stephen Hewitt10-Apr-07 17:43 
Questionhow to differenciate send mail and Reply Mail - webdav ? Pin
ArunkumarSundaravelu10-Apr-07 0:28
ArunkumarSundaravelu10-Apr-07 0:28 
QuestionHow to relate sent Item mail and Inbox mail in webdav method Pin
ArunkumarSundaravelu10-Apr-07 0:26
ArunkumarSundaravelu10-Apr-07 0:26 
QuestionHow to set the ConversationIndex Property ? Pin
ArunkumarSundaravelu10-Apr-07 0:20
ArunkumarSundaravelu10-Apr-07 0:20 
QuestionWindow handle which lost input focus Pin
K Gupta10-Apr-07 0:07
K Gupta10-Apr-07 0:07 

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.