Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtRadioButton causes hang Collapse All
Subject Author Date
Grant McDade Jun 28, 2004 - 12:15 AM

I have discovered that trying to programmatically set the check status of a disabled radio button causes the program to hang. This is because the implementation of the CExtRadioButton does not take into consideration the fact that GetNextDlgGroupItem skips disabled controls. This means that when starting with a disabled control and looping through the group you never reach the starting control again and so the loop never exits.


Regards,
Grant

Technical Support Jun 29, 2004 - 3:00 AM

Dear Grant,

Thank you for the bug information. Please modify the CExtRadioButton::_UncheckRadioButtonsInGroup method in this way:

void CExtRadioButton::_UncheckRadioButtonsInGroup()
{
   ASSERT_VALID (this);
CWnd* pWndParent = GetParent();
   if (pWndParent == NULL)
                  return;
   ASSERT_VALID( pWndParent );
CWnd *pWnd = pWndParent->GetNextDlgGroupItem( this );
   if( !this->IsWindowEnabled() ) return; //INSERT THIS LINE!!!
   while( pWnd != this && pWnd != NULL )
   {
   ...