Click here to Skip to main content
15,903,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: UI thread basics.. Pin
Joaquín M López Muñoz13-Nov-02 10:27
Joaquín M López Muñoz13-Nov-02 10:27 
GeneralRe: UI thread basics.. Pin
RobJones13-Nov-02 10:28
RobJones13-Nov-02 10:28 
GeneralRe: UI thread basics.. Pin
Joaquín M López Muñoz13-Nov-02 10:46
Joaquín M López Muñoz13-Nov-02 10:46 
QuestionHow to open a URL on a different virtual desktop? Pin
Larry Antram13-Nov-02 9:43
Larry Antram13-Nov-02 9:43 
AnswerRe: How to open a URL on a different virtual desktop? Pin
RobJones13-Nov-02 9:58
RobJones13-Nov-02 9:58 
Generalradio button handlers: recursion when using arrow key to switch buttons Pin
David Klotz13-Nov-02 9:13
David Klotz13-Nov-02 9:13 
GeneralRe: radio button handlers: recursion when using arrow key to switch buttons Pin
Alvaro Mendez13-Nov-02 9:51
Alvaro Mendez13-Nov-02 9:51 
GeneralRe: radio button handlers: recursion when using arrow key to switch buttons Pin
Alvaro Mendez13-Nov-02 10:06
Alvaro Mendez13-Nov-02 10:06 
I just tried out your scenario on a "doodle" dialog box I have and amazingly was able to reproduce your problem exactly! Eek! | :eek: Smile | :) .

I don't have an answer as to why it's happening, but my guess is that it has to do with the fact that when you use the arrow key the focus is also changed and that also causes the handler to be called. After you click OK on the message box, the focus goes back to the radio button and it causes the handler to be called again...

Anyway, the way I fixed it is:

void CDoodleDlg::OnRadio2() 
{
	UpdateData();
	if (m_nRadioTest == 1)  // unwanted radio button (Radio2)
	{
		m_nRadioTest = 0;  // change back to good one first (Radio1)
		UpdateData(FALSE);
 
		MessageBox("Hey, isn't it obvious that you shouldn't click on Radio 2?");	
	}
}

Note that I assigned m_nRadioTest inside the Class Wizard for Radio1 and Radio2 (which are grouped together).

Regards,
Alvaro


Well done is better than well said. -- Benjamin Franklin
GeneralRe: radio button handlers: recursion when using arrow key to switch buttons Pin
David Klotz13-Nov-02 11:58
David Klotz13-Nov-02 11:58 
GeneralDynamically resizing a static control Pin
Anonymous13-Nov-02 7:38
Anonymous13-Nov-02 7:38 
GeneralRe: Dynamically resizing a static control Pin
Ravi Bhavnani13-Nov-02 8:11
professionalRavi Bhavnani13-Nov-02 8:11 
GeneralToo many property pages. Pin
DanYELL13-Nov-02 7:21
DanYELL13-Nov-02 7:21 
GeneralRe: Too many property pages. Pin
Daniel Turini13-Nov-02 7:51
Daniel Turini13-Nov-02 7:51 
GeneralRe: Too many property pages. Pin
Ravi Bhavnani13-Nov-02 8:02
professionalRavi Bhavnani13-Nov-02 8:02 
GeneralRe: Too many property pages. Pin
Michael Dunn13-Nov-02 15:48
sitebuilderMichael Dunn13-Nov-02 15:48 
Generalsorting problem Pin
wong190713-Nov-02 7:19
wong190713-Nov-02 7:19 
GeneralRe: sorting problem Pin
Paul M Watt13-Nov-02 8:18
mentorPaul M Watt13-Nov-02 8:18 
GeneralRe: sorting problem Pin
Christian Graus13-Nov-02 10:42
protectorChristian Graus13-Nov-02 10:42 
QuestionRambling ...Draw now, or later with Invalidate ? Pin
Maximilien13-Nov-02 7:08
Maximilien13-Nov-02 7:08 
AnswerRe: Rambling ...Draw now, or later with Invalidate ? Pin
Ravi Bhavnani13-Nov-02 7:12
professionalRavi Bhavnani13-Nov-02 7:12 
GeneralLib files Pin
Anonymous13-Nov-02 6:52
Anonymous13-Nov-02 6:52 
GeneralRe: Lib files Pin
Chris Losinger13-Nov-02 6:59
professionalChris Losinger13-Nov-02 6:59 
GeneralRe: Lib files Pin
Hugo Hallman13-Nov-02 7:18
Hugo Hallman13-Nov-02 7:18 
GeneralCTreeCtrl trouble Pin
act_x13-Nov-02 6:32
act_x13-Nov-02 6:32 
GeneralRe: CTreeCtrl trouble Pin
RobJones13-Nov-02 10:02
RobJones13-Nov-02 10:02 

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.