Click here to Skip to main content
15,913,669 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Scrollbars ?? Pin
Jesper Knudsen7-Jul-04 10:01
Jesper Knudsen7-Jul-04 10:01 
GeneralRe: Scrollbars ?? Pin
0v3rloader7-Jul-04 11:59
0v3rloader7-Jul-04 11:59 
GeneralRe: Scrollbars ?? Pin
Jesper Knudsen7-Jul-04 12:39
Jesper Knudsen7-Jul-04 12:39 
GeneralRe: Scrollbars ?? Pin
0v3rloader7-Jul-04 14:59
0v3rloader7-Jul-04 14:59 
GeneralOk. More Qs on CDynLinkLibrary and apparent leak. Pin
CherezZaboro7-Jul-04 8:18
CherezZaboro7-Jul-04 8:18 
GeneralCheck Boxes Pin
DanYELL7-Jul-04 8:15
DanYELL7-Jul-04 8:15 
GeneralRe: Check Boxes Pin
Ravi Bhavnani7-Jul-04 8:28
professionalRavi Bhavnani7-Jul-04 8:28 
Generalthread (?) question Pin
sandrineV7-Jul-04 7:53
sandrineV7-Jul-04 7:53 
Hello,

I have a CDialog with several buttons. On a button click, children class are called to execute something. My problem is that, sometime, the execution takes awhile, and I can't press the cancel button to stop the execution.

My code looks like that :

CParentClass{
CChildClass* m_ChildClass;

OnButtonClick(){
m_ChildClass->Execute();
}
}

CChildClass{
boolean m_cancel=false;

Execute(){
while(!m_cancel){
//do something
}
}

Thus, I would only want my Parent class to catch the cancel button clik and set the boolean m_cancel to false, while my child class is working.
And I would like this to be done at the parent class level, ie without affecting the code of the child class.

I have read things about threads, and it seems that I could use them to do what I want, but I have a hard time understanding the examples that I have found, ie where in the existing classes the threads need to be put. I have also seen things catching messages (peek message?) but it seems to me that this has to be done at the children class level, in the while loop...

Could anyone redirect me to very simple examples using threads, or help me ?

Thank you
GeneralRe: thread (?) question Pin
palbano7-Jul-04 9:30
palbano7-Jul-04 9:30 
GeneralRe: thread (?) question Pin
sandrineV8-Jul-04 2:55
sandrineV8-Jul-04 2:55 
QuestionMaximaze window ??? Pin
Larsson7-Jul-04 6:41
Larsson7-Jul-04 6:41 
AnswerRe: Maximaze window ??? Pin
jmkhael7-Jul-04 6:44
jmkhael7-Jul-04 6:44 
GeneralRe: Maximaze window ??? Pin
Larsson7-Jul-04 7:04
Larsson7-Jul-04 7:04 
GeneralRe: Maximaze window ??? Pin
jmkhael7-Jul-04 7:08
jmkhael7-Jul-04 7:08 
Generaluser mapping of shortcut keys Pin
John R. Shaw7-Jul-04 6:38
John R. Shaw7-Jul-04 6:38 
GeneralRe: user mapping of shortcut keys Pin
DavidR_r7-Jul-04 8:49
DavidR_r7-Jul-04 8:49 
GeneralRe: user mapping of shortcut keys Pin
John R. Shaw7-Jul-04 9:47
John R. Shaw7-Jul-04 9:47 
GeneralChging default printers Pin
Jim Barrett7-Jul-04 6:28
Jim Barrett7-Jul-04 6:28 
Generalsubclassing in win32 Pin
Manu817-Jul-04 6:14
Manu817-Jul-04 6:14 
GeneralRe: subclassing in win32 Pin
Antti Keskinen7-Jul-04 10:54
Antti Keskinen7-Jul-04 10:54 
GeneralHooK API Problem Pin
cyberkit7-Jul-04 5:19
cyberkit7-Jul-04 5:19 
GeneralHyper-threading and MSDev6 Pin
[d3m0n]7-Jul-04 4:55
[d3m0n]7-Jul-04 4:55 
GeneralInstalling fonts .ttf and Type 1 Pin
Anonymous7-Jul-04 4:15
Anonymous7-Jul-04 4:15 
GeneralInstalling fonts .ttf and Type 1 Pin
Anonymous7-Jul-04 4:13
Anonymous7-Jul-04 4:13 
GeneralRe: Installing fonts .ttf and Type 1 Pin
David Crow7-Jul-04 4:47
David Crow7-Jul-04 4:47 

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.