Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to perform Expression Evaluation Pin
Chris Losinger17-Mar-16 12:33
professionalChris Losinger17-Mar-16 12:33 
GeneralRe: How to perform Expression Evaluation Pin
Patrice T17-Mar-16 13:11
mvePatrice T17-Mar-16 13:11 
AnswerRe: How to perform Expression Evaluation Pin
Patrice T17-Mar-16 13:09
mvePatrice T17-Mar-16 13:09 
AnswerRe: How to perform Expression Evaluation Pin
Bram van Kampen22-Mar-16 14:16
Bram van Kampen22-Mar-16 14:16 
GeneralRe: How to perform Expression Evaluation Pin
David Crow23-Mar-16 2:28
David Crow23-Mar-16 2:28 
GeneralRe: How to perform Expression Evaluation Pin
Bram van Kampen25-Mar-16 13:11
Bram van Kampen25-Mar-16 13:11 
AnswerRe: How to perform Expression Evaluation Pin
Alan Balkany8-Apr-16 6:53
Alan Balkany8-Apr-16 6:53 
QuestionVagarities of Multiple threads in Windows Pin
Bram van Kampen16-Mar-16 14:36
Bram van Kampen16-Mar-16 14:36 
Hi,

I am still struggling on in Silence with Multiple threads, and See working Code break for no apparent reason following minor Edits.

I have read several articles about it, and, if I take all advice to hart, the answer is "You Can't" The Preferred Method of One Expert leads to grave Demise by another.

I am writing a Dialog Based system where a user Logs In, and, perform certain transactions. I am trying to implement a Controlled Log Out (and return to Base) in the absence of User Activity (Mouse Moves, Clicks, Kb Keys Pressed)
In Adittion, when TimeOut comes Close, a Small ProgresBar+ Message Appears , counting Down, only XX Seconds remaining.
I constructed a New Class, CTimedDialog, and a new App Class, CTimedWinApp. The Latter maintains a list of the m_hWnd of the Dialog Stack, and has a Timer, 1 tick per Second. The 'OnInitDialog' of CTimedDialog (This is a Class that sits between CDialog and the Ultimate UserDialog Class)registers the Class with CTimedWinApp. Upon Time-Out, A Registered Message(WM_TIME_OUT) is '::SentMessage'ed from the timer thread,to the hWnd from the Top of the List, following tru to the bottom, giving each dialog the chance to handle the message, and do a Cleanup (if required), and to close the all dialogs, and, so returning to the Base of the initial menu screen.

In adition, as each Dialog 'Knows' it's timeout value, I set up a separate timer in each CTimedDialog, that initially shows a Progress Bar, and a Text Message to display the remaining time. This timer updates the text with SetWindowText(...) and the ProgressControl with SetProgress(...)

Yes, the Progress Controls had their ranges set.

All worked to perfection when I built a Skeleton Application, of essentially blank Dialogs.
Started to fill in Details, Controls, etc, and the App Clock Ticks are no longer recognised.

Question, Do I have a hard to chase Bug, or, do I do something Wrong.

The Core code involved is quite large, too large to publish here, and covers several files.
I can mail the lot to whoever is interested as a ZIP.

As a Bottom line, there are multiple ways to skin a cat. MFC is capable of multithreading, witness the existence of MS-Office
We need to find the Right way of running Multiple threads in MFC from MS. The guidance for now seems to be: don't

Regards,

Smile | :) Smile | :)

Regards Smile | :)
Bram van Kampen

AnswerRe: Vagarities of Multiple threads in Windows Pin
Jochen Arndt16-Mar-16 21:59
professionalJochen Arndt16-Mar-16 21:59 
AnswerRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan16-Mar-16 23:05
mveRichard MacCutchan16-Mar-16 23:05 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen17-Mar-16 16:30
Bram van Kampen17-Mar-16 16:30 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan17-Mar-16 22:51
mveRichard MacCutchan17-Mar-16 22:51 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen18-Mar-16 17:57
Bram van Kampen18-Mar-16 17:57 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan18-Mar-16 22:57
mveRichard MacCutchan18-Mar-16 22:57 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen19-Mar-16 13:41
Bram van Kampen19-Mar-16 13:41 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan19-Mar-16 22:09
mveRichard MacCutchan19-Mar-16 22:09 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen22-Mar-16 13:34
Bram van Kampen22-Mar-16 13:34 
AnswerRe: Vagarities of Multiple threads in Windows Pin
leon de boer19-Mar-16 21:35
leon de boer19-Mar-16 21:35 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen22-Mar-16 13:33
Bram van Kampen22-Mar-16 13:33 
GeneralRe: Vagarities of Multiple threads in Windows Pin
leon de boer25-Mar-16 23:57
leon de boer25-Mar-16 23:57 
QuestionOpenGL control on split MFC form Pin
Member 1228273814-Mar-16 10:08
Member 1228273814-Mar-16 10:08 
AnswerRe: OpenGL control on split MFC form Pin
Richard MacCutchan14-Mar-16 23:48
mveRichard MacCutchan14-Mar-16 23:48 
QuestionDefault argument for DISP_FUNCTION_ID Pin
Member 1214953910-Mar-16 16:44
Member 1214953910-Mar-16 16:44 
AnswerRe: Default argument for DISP_FUNCTION_ID Pin
Bram van Kampen16-Mar-16 15:45
Bram van Kampen16-Mar-16 15:45 
QuestionBoth EnumchildWindows and GetWindow return NULL for a ChildWindow modeless dialogbox Pin
ForNow10-Mar-16 10:19
ForNow10-Mar-16 10:19 

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.