ホーム » MFC » Disable にされたラジオボタンでアサート

2010年1月
 12
3456789
10111213141516
17181920212223
24252627282930
31  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,653 アクセス



Disable にされたラジオボタンでアサート

Disable にされたラジオボタンで,そのボタンが選択状態(値がそのボタン)の時,DDX を使用していると Debug 版でアサートされる.
Release 版では,うまく動作する様に見える場合もあるが,他の値に変更されない場合もある.
UpdateData(FALSE) のみを使用している場合は OK.
//*******************************************************************************
// 関数名 :指定されたコントロールの無効化
// 作成日 :’09/11/11
// 変更日 :’10/01/26 ラジオボタンで選択されている時,アサートされたバグの対応
//*******************************************************************************
inline
BOOL MDlgMod::DisableControlID (CWnd* wnd,const CUIntArray& disCmmdIDs,const BOOL isDisable)
{
    BOOL isEnable = (isDisable) ? FALSE : TRUE ;
    if (wnd == NULL)   { return FALSE ;  }
    for (INT_PTR index=0 ; index<disCmmdIDs.GetSize() ; index++) {
        UINT id = disCmmdIDs[index] ;
        if (id == 0)  { continue ; }
        CWnd* ctrl = wnd->GetDlgItem(id) ;
        if (ctrl == NULL) { continue ; }
        if (!isEnable) {
            if (_AfxIsRadioButton(ctrl->GetSafeHwnd())) {     // CtlPPG.cpp
                if (Button_GetCheck(ctrl->GetSafeHwnd())) {  // WindowsX.h
                    continue ;
                    }
                }
            }
        ctrl->EnableWindow(isEnable) ;
        }
    return TRUE ;
    }
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。