Click here to Skip to main content
15,902,275 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDumb RichEditView Question Pin
merkit6-Jul-04 16:28
merkit6-Jul-04 16:28 
GeneralRe: Dumb RichEditView Question Pin
David Crow7-Jul-04 3:33
David Crow7-Jul-04 3:33 
GeneralCheckRadioButton makes recursive calls Pin
elephantstar6-Jul-04 13:57
elephantstar6-Jul-04 13:57 
GeneralRe: CheckRadioButton makes recursive calls Pin
David Crow7-Jul-04 3:54
David Crow7-Jul-04 3:54 
GeneralRe: CheckRadioButton makes recursive calls Pin
elephantstar7-Jul-04 9:41
elephantstar7-Jul-04 9:41 
GeneralRe: CheckRadioButton makes recursive calls Pin
David Crow7-Jul-04 10:01
David Crow7-Jul-04 10:01 
GeneralRe: CheckRadioButton makes recursive calls Pin
elephantstar7-Jul-04 11:55
elephantstar7-Jul-04 11:55 
GeneralRe: CheckRadioButton makes recursive calls Pin
Blake Miller7-Jul-04 5:11
Blake Miller7-Jul-04 5:11 
I would manually check or uncheck the OTHER radio or checkbox buttons in a handler for a particular button. You are getting recursed because the handler for button 1 is calling a function that will try to UNCHECK buttons 2 and three and CHECK button 1 AGAIN. As a result, your button 1 OnCheckBox1 is getting called from itself.
If you want these three items to be mutualy exclusive, you should try to use radio buttons, and not check boxes. If you group them properly and make them all automatic, you won't even need such a handler to 'set' them in your code. Windows will do it automatically.
If you insist on following your current path, you should do the following instead:

void CCheckBox::OnCheckBox1()
{
// button 1 will check or uncheck itself
// uncheck button 2
CButton* pButton = (CButton*)GetDlgItem(IDC_RADIO2);
pButton->SetCheck(0);
// uncheck button 3
pButton = (CButton*)GetDlgItem(IDC_RADIO3);
pButton->SetCheck(0);
}

void CCheckBox::OnCheckBox2()
{
// uncheck button 1
CButton* pButton = (CButton*)GetDlgItem(IDC_RADIO1);
pButton->SetCheck(0);
// button 2 will check or uncheck itself
// uncheck button 3
pButton = (CButton*)GetDlgItem(IDC_RADIO3);
pButton->SetCheck(0);
}

similarly for button 3.

GeneralRe: CheckRadioButton makes recursive calls Pin
elephantstar7-Jul-04 9:48
elephantstar7-Jul-04 9:48 
GeneralRe: CheckRadioButton makes recursive calls Pin
Blake Miller7-Jul-04 11:38
Blake Miller7-Jul-04 11:38 
GeneralRe: CheckRadioButton makes recursive calls Pin
elephantstar7-Jul-04 12:40
elephantstar7-Jul-04 12:40 
GeneralRe: CheckRadioButton makes recursive calls Pin
David Crow8-Jul-04 2:41
David Crow8-Jul-04 2:41 
GeneralRe: CheckRadioButton makes recursive calls Pin
elephantstar8-Jul-04 11:14
elephantstar8-Jul-04 11:14 
GeneralRe: CheckRadioButton makes recursive calls Pin
David Crow9-Jul-04 4:50
David Crow9-Jul-04 4:50 
GeneralCalling all people, I need your input. Pin
mayanxn036-Jul-04 13:17
mayanxn036-Jul-04 13:17 
GeneralRe: Calling all people, I need your input. Pin
David Crow7-Jul-04 3:57
David Crow7-Jul-04 3:57 
GeneralInsertMenuItem makes menu display with wrong width Pin
siggapet6-Jul-04 13:03
siggapet6-Jul-04 13:03 
GeneralTray icon tooltip Pin
ace//236-Jul-04 10:06
ace//236-Jul-04 10:06 
GeneralRe: Tray icon tooltip Pin
Ravi Bhavnani6-Jul-04 10:44
professionalRavi Bhavnani6-Jul-04 10:44 
GeneralRe: Tray icon tooltip Pin
ThatsAlok7-Jul-04 0:18
ThatsAlok7-Jul-04 0:18 
QuestionWhat's the best leak finder tool for VC 6? Pin
CherezZaboro6-Jul-04 9:46
CherezZaboro6-Jul-04 9:46 
AnswerRe: What's the best leak finder tool for VC 6? Pin
Johan Rosengren6-Jul-04 10:44
Johan Rosengren6-Jul-04 10:44 
GeneralRe: What's the best leak finder tool for VC 6? Pin
CherezZaboro6-Jul-04 11:40
CherezZaboro6-Jul-04 11:40 
GeneralRe: What's the best leak finder tool for VC 6? Pin
Johan Rosengren6-Jul-04 21:05
Johan Rosengren6-Jul-04 21:05 
GeneralRe: What's the best leak finder tool for VC 6? Pin
CherezZaboro7-Jul-04 3:32
CherezZaboro7-Jul-04 3:32 

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.