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 General Discussion » Modalless Error Collapse All
Subject Author Date
Seung Cheol Lee Aug 2, 2007 - 6:44 PM

Hello
I used modalless dialog.
When I click OK button on the dialog using mouse, the code is below.
( The short key of OK button is Alt+O : Alt&O)
----------------------------------------------------------------------------------------------------
void MyDlg::OnOK ()
{
...

    CExtNCW<CExtResizableDialog>::OnOK();
    DestroyWindow();
}

void MyDlg::PostNcDestroy()
{
    CExtNCW<CExtResizableDialog>::PostNcDestroy();
    theApp.GetMainFrame()->m_pMyDlg = NULL;
    delete this;
}
----------------------------------------------------------------------------------------------------


But
Doing OK operation on the modalless dialog using the short key (Alt+O),
Error occured below
( ? : Error didn’t occure on the modal dialog )

----------------------------------------------------------------------------------------------------
bool CExtAnimationClient::AnimationClient_CacheNextStateMinInfo(
    bool bAnimate,
    INT eAPT // __EAPT_*** animation type
    )
{
    ASSERT( this != NULL );
CExtAnimationSite * pAcAS = AnimationClient_SiteGet(); <--------- ( Access Error )
    if( pAcAS == NULL )
        return false;
HWND hWnd = pAcAS->AnimationSite_GetSafeHWND();
    if( hWnd == NULL )
        return false;
    ASSERT( ::IsWindow( hWnd ) );
CRect rcAcAnimationTarget = AnimationClient_TargetRectGet();
    return
        AnimationClient_CacheNextState(
            hWnd,
            rcAcAnimationTarget,
            bAnimate,
            eAPT
            );
}
----------------------------------------------------------------------------------------------------

Do you know about the problem.
And can you tell me the solution of the problem ?

Technical Support Aug 6, 2007 - 8:21 AM

Could you show as the content of the Call Stack window in your Visual Studio? Additionally, you should not invoke any code in the OnOK() and OnCancel() virtual methods after invoking the same parent class methods.

Seung Cheol Lee Aug 8, 2007 - 3:58 AM

This is the Call Stack.

===============================================================================================================

ProfUIS280ud.dll!CExtAnimationClient::AnimationClient_CacheNextStateMinInfo(bool bAnimate=true, int eAPT=0) 줄 504 + 0xa 바이트    C++
ProfUIS280ud.dll!CExtButton::_QuickActivationHandle() 줄 1234    C++
ProfUIS280ud.dll!CExtButton::PreTranslateMessage(tagMSG * pMsg=0x001f0550) 줄 1198 + 0x12 바이트    C++
mfc80ud.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x00030624, tagMSG * pMsg=0x001f0550) 줄 2882 + 0x14 바이트    C++
mfc80ud.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x001f0550) 줄 233 + 0x12 바이트    C++
mfc80ud.dll!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x001f0550) 줄 773 + 0x9 바이트    C++
NM.exe!CNmApp::PreTranslateMessage(tagMSG * pMsg=0x001f0550) 줄 293    C++
mfc80ud.dll!AfxPreTranslateMessage(tagMSG * pMsg=0x001f0550) 줄 252 + 0x11 바이트    C++
mfc80ud.dll!AfxInternalPumpMessage() 줄 178 + 0x18 바이트    C++
mfc80ud.dll!CWinThread::PumpMessage() 줄 896    C++
mfc80ud.dll!CWinThread::Run() 줄 625 + 0xd 바이트    C++
mfc80ud.dll!CWinApp::Run() 줄 894    C++
mfc80ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x001c2ff8, int nCmdShow=1) 줄 47 + 0xd 바이트    C++
NM.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x001c2ff8, int nCmdShow=1) 줄 33    C++
NM.exe!__tmainCRTStartup() 줄 589 + 0x35 바이트    C
NM.exe!wWinMainCRTStartup() 줄 414    C
kernel32.dll!75ec3833()     
[아래 프레임은 올바르지 않거나 누락되었거나 kernel32.dll에 대해 로드된 기호가 없음]    
ntdll.dll!76efa9bd()

===============================================================================================================

Technical Support Aug 8, 2007 - 7:49 AM

Unfortunately we cannot reproduce the problem. We would like to ask you to do the following experiment:

1) Find the following line of code at the beginning of the CExtButton::_QuickActivationHandle() method in the ../Prof-UIS/Src/ExtButton.cpp file:

      ASSERT( GetSafeHwnd() != NULL );
2) Replace it with the following code:
      if( GetSafeHwnd() == NULL )
            return;
3) Rebuild Prof-UIS and your project, run your application and let us know if the problem persists.

Seung Cheol Lee Aug 8, 2007 - 8:19 PM

The problem have persisted as ever.
I have sent you the error sample code. --> [support@prof-uis.com]
Please , can you confirm the error sample code.

Technical Support Aug 9, 2007 - 12:32 PM

We tested you project but came across no crashes. We just invoked the Test | Test menu from the menu bar and clicked the OK button on the displayed small dialog. Nothing happened. Do we need to invoke some special actions to reproduce the crash?

Seung Cheol Lee Aug 9, 2007 - 5:34 PM

I’m sorry. I have not written the error action.
You need to invoke accelerator key ( Alt + O ) instead of clicking the OK button on the displayed small dialog.

Seung Cheol Lee Aug 9, 2007 - 6:13 PM

I’m sorry. I have not written the error action.
You need to invoke accelerator key ( Alt + O ) instead of clicking the OK button on the displayed small dialog.

Technical Support Aug 10, 2007 - 5:43 AM

We have successfully reproduced the assertion failure. Thank you for reporting it. Please update the source code for the following two methods of the CExtButton class in the ../Prof-UIS/Src/ExtButton.cpp file:

BOOL CExtButton::PreTranslateMessage(MSG* pMsg) 
{
      if(         (! CExtPopupMenuWnd::IsMenuTracking() )
            &&    OnAdvancedPopupMenuTipWndGet() == NULL
            )
      {
            InitToolTip();
            m_wndToolTip.RelayEvent( pMsg );
      }

      if(         ( pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP )
            &&    ( pMsg->wParam == VK_RETURN || pMsg->wParam == VK_SPACE )
            )
      {
            bool bEnabled = OnQueryWindowEnabledState();
            if(         bEnabled
                  &&    IsWindowVisible()
                  )
            {
                  if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN )
                  {
                        _OnClick( true, false );
                        return TRUE;
                  }

                  if(         pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_SPACE 
                        &&    (!m_bPushTracking)
                        )
                  {
                        bool bAnimationLocked = AnimationClient_CacheGeneratorIsLocked();
                        if( ! bAnimationLocked )
                        {
                              AnimationClient_CacheGeneratorLock();
                              AnimationClient_CacheNextStateMinInfo(
                                    false,
                                    __EAPT_BY_PRESSED_STATE_TURNED_ON
                                    );
                        }
                        m_bPushed = m_bPushTracking = m_bKeyTracking = true;
                        if( ! bAnimationLocked )
                        {
                              AnimationClient_CacheNextStateMinInfo(
                                    true,
                                    __EAPT_BY_PRESSED_STATE_TURNED_ON
                                    );
                              AnimationClient_CacheGeneratorUnlock();
                        }
                        Invalidate();
                        return TRUE;
                  }

                  if(   pMsg->message == WM_KEYUP && pMsg->wParam == VK_SPACE )
                  {
                        bool bAnimationLocked = AnimationClient_CacheGeneratorIsLocked();
                        if( ! bAnimationLocked )
                        {
                              AnimationClient_CacheGeneratorLock();
                              AnimationClient_CacheNextStateMinInfo(
                                    false,
                                    __EAPT_BY_PRESSED_STATE_TURNED_OFF
                                    );
                        }
                        m_bPushed = m_bPushTracking = m_bKeyTracking = m_bMouseOver = false;
                        _OnClick( true, false );
                        if( ! bAnimationLocked )
                        {
                              AnimationClient_CacheNextStateMinInfo(
                                    true,
                                    __EAPT_BY_PRESSED_STATE_TURNED_OFF
                                    );
                              AnimationClient_CacheGeneratorUnlock();
                        }
                        return TRUE;
                  }
            }
            return TRUE;
      }
      if(         m_bQuickActivationEnabled
            &&    (     pMsg->message == WM_KEYUP
                  ||    pMsg->message == WM_SYSKEYUP
                  )
            )
      {
            if( _QuickActivationCheck( DWORD(pMsg->wParam) ) )
            {
                  HWND hWndOwn = GetSafeHwnd();
                  if( _QuickActivationHandle() )
                  {
                        if(         hWndOwn == NULL
                              ||    (! ::IsWindow( hWndOwn ) )
                              )
                              return TRUE;
                        return FALSE;
                  }
            }
      }
      return CButton::PreTranslateMessage(pMsg);
}

bool CExtButton::_QuickActivationHandle()
{
      ASSERT_VALID( this );
      ASSERT( GetSafeHwnd() != NULL );
HWND hWndOwn = GetSafeHwnd();
bool bAnimationLocked = AnimationClient_CacheGeneratorIsLocked();
      if( ! bAnimationLocked )
      {
            m_bPushed = true;
            AnimationClient_CacheGeneratorLock();
            AnimationClient_CacheNextStateMinInfo(
                  false,
                  __EAPT_BY_PRESSED_STATE_TURNED_ON
                  );
            Invalidate();
            UpdateWindow();
            m_bPushed = false;
      }
      _OnClick( true, m_bQuickActivationSeparatedDropDown );
      if(         hWndOwn == NULL
            ||    (! ::IsWindow( hWndOwn ) )
            )
            return true;
      if( ! bAnimationLocked )
      {
            AnimationClient_CacheNextStateMinInfo(
                  true,
                  __EAPT_BY_HOVERED_STATE_TURNED_ON
                  );
            AnimationClient_CacheGeneratorUnlock();
      }
      return true;
}