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 » A bug and a question Collapse All
Subject Author Date
Mauro L Apr 4, 2007 - 5:43 PM

Hi, I downloaded the latest samples and free source code.

First I wan’t to report a bug. Most demos (e.g. FixedSizePanels) crashes when I try to move docked bar (in order to make it floating). I notice that if I unload Windowblinds the problem does not occur.

I don’t know if the error is caused by the same thing, but in the source code I removed the comments shown below from extpaintmanager.cpp and, at least, my tests worked fine.

//         if( pBar == NULL )
//         {
//             CExtPaintManagerOffice2003::PaintGripper( dc, _pgd );
//             return;
//         }

Also I have two questions:

1) I make a resizable bar derived from CExtControlBar and set EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT) on the object but the framework stills allows it to be docked on top or in the bottom area.

2) In the same object (using luna 2007 r2) I don’t understand the behavior of client area. The caption occupes the first 2 or 3 pixel lines on top if the bar is floating. If I do not pass lbuttondown, lbuttonup and mousemove messages to the CExtControlBar original handler, I cannot resize/move the bar (docked or floating). If the GetClientRect gives me an area, all outside of this should be the nonclient area and the caption should response to wm_nclbutton messages.

Best regards, Mauro.

Mauro L Apr 5, 2007 - 7:56 AM

Hi,

The error always appears in the compiled samples provided on the site. In this case, in mdi-m.exe when I want to undock a bar. The modification in the source code was done for my personal tests to make a temporary fix, but I am unsure if this error is the same. I compile
the static libraries following all the guidelines.

I have WindowBlinds 5.0 (build 49) with the "Wire and glass v2.01" skin. If I unload wb, problem dissapears.

Details of the error:

AppName: MDI-m.exe AppVer: 2.6.4.0 ModName: profuis264m.dll

Exception error C0000005

Stack:
>    ProfUIS264m.dll!10172b9a()     
    [Frames below may be incorrect and/or missing, no symbols loaded for ProfUIS264m.dll]    
    user32.dll!7e39882a()     
    user32.dll!7e39b89b()     
    ProfUIS264m.dll!1014f69d()     
    ProfUIS264m.dll!10118420()     
    ProfUIS264m.dll!10118441()     
    ProfUIS264m.dll!1011805e()     
    mfc42.dll!73d51eb6()     
    ntdll.dll!7c9205c8()     
    ntdll.dll!7c920551()     
    ntdll.dll!7c92056d()     
    mfc42.dll!73d51b9b()     
    ProfUIS264m.dll!10119add()     
    mfc42.dll!73d51b05()     
    mfc42.dll!73de82b0()     
    mfc42.dll!73d51a58()     
    mfc42.dll!73de847d()     
    user32.dll!7e398734()     
    user32.dll!7e398816()     
    user32.dll!7e39c63f()     
    user32.dll!7e39f65d()     
    wblind.dll!6600bd62()     
    user32.dll!7e39eca9()     
    user32.dll!7e398b26()     
    user32.dll!7e399488()     
    user32.dll!7e399491()     
    wblind.dll!6601f6af()     
    ntdll.dll!7c923288()     
    ntdll.dll!7c9266f1()     
    ntdll.dll!7c92657e()     
    ntdll.dll!7c91fb6c()     
    ntdll.dll!7c91fb71()     
    kernel32.dll!7c809382()     
    ntdll.dll!7c91fb6c()     
    ntdll.dll!7c91fb71()     
    kernel32.dll!7c809382()     
    kernel32.dll!7c80e6d2()     
    kernel32.dll!7c80e62b()     
    ntdll.dll!7c925041()     
    ntdll.dll!7c925233()     
    ntdll.dll!7c925f0b()     
    ntdll.dll!7c925152()     
    user32.dll!7e39d038()     
    user32.dll!7e39b89b()     
    user32.dll!7e3af3cc()     
    wl_hook.dll!00b08756()     
    wl_hook.dll!00b14d99()     
    wl_hook.dll!00b1effb()     
    wblind.dll!660102e9()     
    wblind.dll!660102e9()     
    ntdll.dll!7c925707()     
    ntdll.dll!7c925707()     
    ntdll.dll!7c925a65()     
    ntdll.dll!7c925a00()     
    ntdll.dll!7c925a65()     
    user32.dll!7e39e611()     
    ntdll.dll!7c920945()     
    ntdll.dll!7c92094e()     
    ntdll.dll!7c92440e()     
    ntdll.dll!7c920970()     
    ntdll.dll!7c924481()     
    ntdll.dll!7c924859()     
    ntdll.dll!7c9205c8()     
    ntdll.dll!7c920551()     
    ntdll.dll!7c92056d()     
    ntdll.dll!7c923288()     
    ntdll.dll!7c9266f1()     
    ntdll.dll!7c92657e()     
    ntdll.dll!7c91fb6c()     
    ntdll.dll!7c91fb71()     
    user32.dll!7e398b26()     
    user32.dll!7e39d4ee()     
    kernel32.dll!7c809e60()     
    wblind.dll!6601e559()     
    user32.dll!7e39d4ee()     
    user32.dll!7e3988d1()     
    user32.dll!7e3988da()     
    gdi32.dll!77ef8ef9()     
    gdi32.dll!77efb167()     
    gdi32.dll!77efb130()     
    user32.dll!7e39e1a5()     
    user32.dll!7e39d4ee()     
    wblind.dll!6601daf0()     
    user32.dll!7e3af11d()     
    user32.dll!7e39d4ee()     
    user32.dll!7e39d5ac()     
    user32.dll!7e398734()     
    user32.dll!7e39d4ee()     
    user32.dll!7e39d4ee()     
    user32.dll!7e398816()     
    user32.dll!7e39d4ee()     
    user32.dll!7e39d4ee()     
    user32.dll!7e39c63f()     
    user32.dll!7e39d4ee()     
    user32.dll!7e39f65d()     
    user32.dll!7e39d4ee()     
    mfc42.dll!73d5216b()     
    user32.dll!7e39d4ee()     
    mfc42.dll!73d521ec()     
    mfc42.dll!73dba4b9()     
    ProfUIS264m.dll!1011859f()     
    mfc42.dll!73d51e91()     
    mfc42.dll!73d51b05()     
    mfc42.dll!73de82b0()     
    mfc42.dll!73d51b9b()     
    ProfUIS264m.dll!10119add()     
    mfc42.dll!73d51b05()     
    mfc42.dll!73de82b0()     
    mfc42.dll!73d51a58()     
    mfc42.dll!73de847d()     
    user32.dll!7e398734()     
    user32.dll!7e398816()     
    user32.dll!7e39b89b()     
    user32.dll!7e3af3cc()     
    wl_hook.dll!00b08756()     
    wl_hook.dll!00b14d99()     
    wl_hook.dll!00b1effb()     
    mfc42.dll!73dbb292()     
    mfc42.dll!73dbb292()     
    mfc42.dll!73d52047()     
    kernel32.dll!7c809e60()     
    wblind.dll!66012295()     
    wblind.dll!6601e2d0()     
    user32.dll!7e39d4ee()     
    user32.dll!7e398bd9()     
    mfc42.dll!73d51b9b()     
    ProfUIS264m.dll!10119add()     
    mfc42.dll!73d51b05()     
    mfc42.dll!73de82b0()     
    mfc42.dll!73d51a58()     
    mfc42.dll!73de847d()     
    user32.dll!7e398734()     
    user32.dll!7e398816()     
    user32.dll!7e39b89b()     
    user32.dll!7e3af3cc()     
    wl_hook.dll!00b08756()     
    wl_hook.dll!00b14d99()     
    wl_hook.dll!00b1effb()     
    user32.dll!7e3af383()     
    mfc42.dll!73dba3fd()     
    mfc42.dll!73dba3fd()     
    mfc42.dll!73d51e91()     
    mfc42.dll!73d51fd3()     
    mfc42.dll!73d51b9b()     
    ProfUIS264m.dll!10119add()     
    mfc42.dll!73d51b05()     
    mfc42.dll!73de82b0()     
    mfc42.dll!73d51a58()     
    mfc42.dll!73de847d()     
    user32.dll!7e398734()     
    user32.dll!7e398816()     
    user32.dll!7e39b4c0()     
    user32.dll!7e39f9fe()     
    ntdll.dll!7c91eae3()     
    user32.dll!7e39fe13()     
    user32.dll!7e39fdd9()     
    wblind.dll!66008895()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c9206ab()     
    ntdll.dll!7c9206eb()     
    comctl32.dll!773c99b0()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c921596()     
    ntdll.dll!7c9206eb()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c9206ab()     
    ntdll.dll!7c9206eb()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c9206eb()     
    ntdll.dll!7c920551()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c9206ab()     
    ntdll.dll!7c9206eb()     
    ntdll.dll!7c925041()     
    ntdll.dll!7c925233()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c920732()     
    ntdll.dll!7c9206ab()     
    ntdll.dll!7c9206eb()     
    ntdll.dll!7c92554a()     
    ntdll.dll!7c9205c8()     
    ntdll.dll!7c920551()     
    ntdll.dll!7c92056d()     
    ntdll.dll!7c92056d()     
    user32.dll!7e399951()     
    ntdll.dll!7c920833()     
    user32.dll!7e3999e4()     
    user32.dll!7e399a12()     
    ntdll.dll!7c92056d()     
    user32.dll!7e39a592()     
    user32.dll!7e39a5b0()     
    user32.dll!7e39d4ee()     
    user32.dll!7e398df1()     
    ntdll.dll!7c920833()     
    user32.dll!7e39fecc()     
    user32.dll!7e39a876()     
    user32.dll!7e39ff66()     
    mfc42.dll!73d5bba4()     
    mfc42.dll!73dba36c()     
    mfc42.dll!73db3f49()     
    ProfUIS264m.dll!10116cb4()     
    ProfUIS264m.dll!1005a649()     
    ProfUIS264m.dll!1005a81b()     
    ProfUIS264m.dll!10049a63()     
    wbhelp.dll!66603fd4()     
    ProfUIS264m.dll!10059fce()     
    ProfUIS264m.dll!1005345b()     
    ProfUIS264m.dll!100527a8()     
    mfc42.dll!73d511a8()     
    wbhelp.dll!66603fd4()     
    ProfUIS264m.dll!1004f2e3()     
    mfc42.dll!73d51ff8()     
    user32.dll!7e398734()     
    user32.dll!7e398bd9()     
    user32.dll!7e39885a()     
    user32.dll!7e39882a()     
    mfc42.dll!73d51b9b()     
    mfc42.dll!73d52a10()     
    ProfUIS264m.dll!1004c14a()     
    ProfUIS264m.dll!100fe83c()     
    ProfUIS264m.dll!100fe852()     
    ProfUIS264m.dll!100fe924()     
    ProfUIS264m.dll!10094144()     
    mfc42.dll!73d51b05()     
    mfc42.dll!73de82b0()     
    mfc42.dll!73d51a58()     
    mfc42.dll!73de847d()     
    user32.dll!7e398734()     
    user32.dll!7e398816()     
    user32.dll!7e3989cd()     
    user32.dll!7e3996c7()     
    mfc42.dll!73d5125a()     
    mfc42.dll!73d5b55f()     
    mfc42.dll!73d5cf95()     
    MDI-m.exe!00407a79()     
    MDI-m.exe!004070b1()     
    kernel32.dll!7c816fd7()     


10172B6F push eax
10172B70 call dword ptr ds:[102790ACh]
10172B76 cmp eax,8
10172B79 jle 10172F79
10172B7F mov ecx,dword ptr [esi]
10172B81 push 102922F0h
10172B86 call 1025CF10
10172B8B test eax,eax
10172B8D je 10172BC0
10172B8F mov ecx,dword ptr [esi]
10172B91 call 10117CA0
10172B96 mov ebx,eax
10172B98 mov ecx,ebx
10172B9A mov edx,dword ptr [ebx] <-----
10172B9C call dword ptr [edx+160h]
10172BA2 test al,al
10172BA4 jne 10172BB6
10172BA6 push 10285018h
10172BAB mov ecx,ebx
10172BAD call 1025CF10
10172BB2 test eax,eax
10172BB4 je 10172BC0
10172BB6 mov al,byte ptr [esi+28h]
10172BB9 and al,0F6h
10172BBB or al,2
10172BBD mov byte ptr [esi+28h],al
10172BC0 lea edx,[esi+8]
10172BC3 mov ecx,edx

Best regards,
Mauro.

Technical Support Apr 10, 2007 - 2:58 AM


We successfully reproduced the crash with Window Blinds 5 and FixedSizePanels sample. You can fix it by updating the source code for the following method in the ../Prof-UIS/Src/ExtControlBar.cpp file:

bool CExtControlBar::InternalDraggingState_t::_DoFixed_OuterDockerAdjustment(
      CPoint ptTrack, // in screen coords
      CExtDockOuterBar * pOuterDocker
      )
{
      ASSERT_VALID( m_pExtBarSrc );
      ASSERT_VALID( m_pExtBarSrc->m_pDockSite );
      ASSERT_VALID( pOuterDocker );

      g_DragStateOld.SetCFR( __ECFR_NO_RESIZING );

      if(   (           pOuterDocker->m_dwStyle 
                  &     m_pExtBarSrc->m_dwDockStyle
                  &     CBRS_ALIGN_ANY
                  ) == 0
            )
            return false;

CRect rcGrip = m_pExtBarSrc->_RectGripGet();
INT nCyGripper = min( rcGrip.Width(), rcGrip.Height() );
CSize sizeOffset( nCyGripper, nCyGripper/2 );

UINT nDockBarID = pOuterDocker->GetDlgCtrlID();
      ASSERT_DOCKBAR_DLGCTRLID_DOCKED( nDockBarID );
BOOL bHorzDockBar = 
            (     nDockBarID == AFX_IDW_DOCKBAR_TOP
            ||    nDockBarID == AFX_IDW_DOCKBAR_BOTTOM )
            ? TRUE : FALSE;

      if( bHorzDockBar )
      {
            sizeOffset.cx = m_pExtBarSrc->m_ptHelperDragOffsetDockedH.x;
            sizeOffset.cy = m_pExtBarSrc->m_ptHelperDragOffsetDockedH.y;
      }
      else
      {
            sizeOffset.cx = m_pExtBarSrc->m_ptHelperDragOffsetDockedV.x;
            sizeOffset.cy = m_pExtBarSrc->m_ptHelperDragOffsetDockedV.y;
      }

      if( pOuterDocker != m_pExtBarSrc->m_pDockBar )
      {
            CSize sizeDocked =
                  m_pExtBarSrc->CalcFixedLayout(
                        FALSE,
                        bHorzDockBar
                        );
            ASSERT_VALID( m_pExtBarSrc->m_pDockBar );
            CRect rcInsert( ptTrack - sizeOffset, sizeDocked );
            m_pExtBarSrc->_AffixmentSafeClearOuter();
            pOuterDocker->DockControlBar(
                  m_pExtBarSrc,
                  rcInsert,
                  true
                  );
            if(         m_pExtBarSrc->_IsDockSiteCustomizeMode()
                  &&    (!m_pExtBarSrc->IsSingleOnRow())
                  )
                  m_pExtBarSrc->MakeSingleOnRow();
            m_pExtBarSrc->_AffixmentRecalcOuter();
            m_pExtBarSrc->m_pDockSite->RecalcLayout();
            return true;
      } // if( pOuterDocker != m_pExtBarSrc->m_pDockBar )

bool bSwap = false;
CRect rcAllRow;
MfcControlBarVector_t vRow;
      m_pExtBarSrc->_GetRowBars(
            vRow,
            &rcAllRow,
            NULL,
            NULL,
            &bSwap
            );
      ASSERT( vRow.GetSize() > 0 );

int nMoveUpDownDirection = 0;
int nAdjustPixelsLT = 0, nAdjustPixelsRB = 0;
      if(         nDockBarID == AFX_IDW_DOCKBAR_RIGHT
            ||    nDockBarID == AFX_IDW_DOCKBAR_BOTTOM
            )
            nAdjustPixelsRB = -2;
      else
            nAdjustPixelsLT = 2;
CRect rcUpDownAnalyze( rcAllRow );
      if( bHorzDockBar )
      {
            rcUpDownAnalyze.InflateRect( 0, 1 );
            if(         ptTrack.y <= (rcUpDownAnalyze.top + nAdjustPixelsLT)
                  ||    ptTrack.y >= (rcUpDownAnalyze.bottom + nAdjustPixelsRB)
                  )
            {
                  if( ptTrack.y <= (rcUpDownAnalyze.top + nAdjustPixelsLT) )
                        nMoveUpDownDirection = -1;
                  else
                        nMoveUpDownDirection = 1;
            }
      } // if( bHorzDockBar )
      else
      {
            rcUpDownAnalyze.InflateRect( 1, 0 );
            if(         ptTrack.x <= (rcUpDownAnalyze.left + nAdjustPixelsLT)
                  ||    ptTrack.x >= (rcUpDownAnalyze.right + nAdjustPixelsRB)
                  )
            {
                  if( ptTrack.x <= (rcUpDownAnalyze.left + nAdjustPixelsLT) )
                        nMoveUpDownDirection = -1;
                  else
                        nMoveUpDownDirection = 1;
            }
      } // else from if( bHorzDockBar )
      if( nMoveUpDownDirection != 0 )
      {
            if( vRow.GetSize() != 1 )
            {
                  m_pExtBarSrc->_AffixmentSafeClearOuter();
                  pOuterDocker->_NewRowDockControlBar(
                        m_pExtBarSrc,
                        m_pExtBarSrc,
                        (nMoveUpDownDirection < 0) ? true : false
                        );
                  m_pExtBarSrc->_AffixmentRecalcOuter();

                  m_pExtBarSrc->_AffixmentRecalcOuter();
                  _DoFixed_StaticMinimalDockSiteRecalc(
                        m_pExtBarSrc->m_pDockSite,
                        pOuterDocker
                        );
                  return true;
            } // if( vRow.GetSize() != 1 )

            bool bSwapXtra = false;
            CRect rcAllRow2;
            MfcControlBarVector_t vRow2;
            m_pExtBarSrc->_GetNextRowBars(
                  (nMoveUpDownDirection < 0) ? false : true,
                  vRow2,
                  &rcAllRow2,
                  NULL,
                  NULL,
                  &bSwapXtra
                  );
            if( bSwapXtra && (!bSwap) && vRow2.GetSize() > 0 )
            {
                  CRect rcOuterDockerClient;
                  pOuterDocker->GetClientRect( &rcOuterDockerClient );
                  int nOuterDockerExtent = bHorzDockBar
                        ? rcOuterDockerClient.Width()
                        : rcOuterDockerClient.Height()
                        ;
                  CSize sizeDragMin = m_pExtBarSrc->_CalcDesiredMinOuterSize( bHorzDockBar );
                  int nExtentDragMin = bHorzDockBar
                        ? sizeDragMin.cx
                        : sizeDragMin.cy
                        ;
                  int nExtentOtherOuterMin = 0;
                  for( int nBar = 0; nBar < vRow2.GetSize(); nBar++ )
                  {
                        CControlBar * pOtherBar = vRow2[nBar];
                        ASSERT_VALID( pOtherBar );
                        ASSERT_KINDOF( CControlBar, pOtherBar );
                        CExtControlBar * pExtBar =
                              DYNAMIC_DOWNCAST( CExtControlBar, pOtherBar );
                        CRect rcBarWnd;
                        pOtherBar->GetWindowRect( &rcBarWnd );
                        nExtentOtherOuterMin += bHorzDockBar
                              ? rcBarWnd.Width()
                              : rcBarWnd.Height()
                              ;
                        if(         pExtBar != NULL
                              &&    pExtBar->IsFixedMode()
                              &&    (! pExtBar->_GetFullRowMode() )
                              )
                        {
                              CRect rcBarClient;
                              pOtherBar->GetClientRect( &rcBarClient );
                              CSize sizeOtherOuterMin = pExtBar->_CalcDesiredMinOuterSize( bHorzDockBar );
                              nExtentOtherOuterMin += bHorzDockBar
                                    ? (sizeOtherOuterMin.cx - rcBarClient.Width())
                                    : (sizeOtherOuterMin.cy - rcBarClient.Height())
                                    ;
                        }
                  } // for( int nBar = 0; nBar < vRow2.GetSize(); nBar++ )
                  if( (nExtentDragMin + nExtentOtherOuterMin) < nOuterDockerExtent )
                        bSwapXtra = false;
            } // if( bSwapXtra && (!bSwap) && vRow2.GetSize() > 0 )
            
            if(         m_pExtBarSrc->_IsDockSiteCustomizeMode()
                  &&    m_pExtBarSrc->IsSingleOnRow()
                  )
                  bSwap = true;

            if( bSwap || bSwapXtra )
            {
                  if( vRow2.GetSize() > 0 )
                  {
                        CRect wrDockBar;
                        pOuterDocker->GetWindowRect( &wrDockBar );
                        CRect rcAnalyze( rcAllRow2 );
                        if( bHorzDockBar )
                        {
                              rcAnalyze.left = wrDockBar.left;
                              rcAnalyze.right = wrDockBar.right;
                        } // if( bHorzDockBar )
                        else
                        {
                              rcAnalyze.top = wrDockBar.top;
                              rcAnalyze.bottom = wrDockBar.bottom;
                        } // else from if( bHorzDockBar )
                        if( nMoveUpDownDirection < 0 )
                        {
                              rcAnalyze.OffsetRect(
                                    bHorzDockBar ? 0 : (rcAllRow.right - rcAllRow2.right),
                                    bHorzDockBar ? (rcAllRow.bottom - rcAllRow2.bottom) : 0
                                    );
                        } // if( nMoveUpDownDirection < 0 )
                        else
                        {
                              rcAnalyze.OffsetRect(
                                    bHorzDockBar ? 0 : (rcAllRow2.right - rcAllRow.right),
                                    bHorzDockBar ? (rcAllRow2.bottom - rcAllRow.bottom) : 0
                                    );
                        } // else from if( nMoveUpDownDirection < 0 )
                        if( !rcAnalyze.PtInRect(ptTrack) )
                        {
                              _DoFixed_StaticOuterRowSwap(
                                    vRow2[0],
                                    vRow[0]
                                    );
                              _DoFixed_StaticMinimalDockSiteRecalc(
                                    m_pExtBarSrc->m_pDockSite,
                                    pOuterDocker
                                    );
                              return true;
                        } // if( !rcAnalyze.PtInRect(ptTrack) )
                  } // if( vRow2.GetSize() > 0 )
            } // if( bSwap || bSwapXtra )
            else
            {
                  ASSERT( !bSwap );
                  ASSERT( !bSwapXtra );
                  if( vRow2.GetSize() != 0 )
                  {
                        // do redock to existing row
                        CRect rcBar;
                        m_pExtBarSrc->GetWindowRect( &rcBar );
                        pOuterDocker->ScreenToClient( &rcBar );
                        int nOffsetInRowActual = bHorzDockBar
                                    ? rcBar.left
                                    : rcBar.top
                                    ;
                        CPoint ptShifted( ptTrack - sizeOffset );
                        pOuterDocker->ScreenToClient( &ptShifted );
                        int nOffsetInRowDesired = bHorzDockBar
                                    ? ptShifted.x
                                    : ptShifted.y
                                    ;
                        int nShiftDesired = nOffsetInRowDesired - nOffsetInRowActual;
                        
                        //m_pExtBarSrc->_AffixmentSafeClearOuter();
                        if( pOuterDocker->_ReDockToNewRow(
                                    m_pExtBarSrc,
                                    vRow2,
                                    nShiftDesired
                                    )
                              )
                        { // if redock to new row is successful
                              m_pExtBarSrc->_AffixmentRecalcOuter();
                              _DoFixed_StaticMinimalDockSiteRecalc(
                                    m_pExtBarSrc->m_pDockSite,
                                    pOuterDocker
                                    );
                              return true;
                        } // if redock to new row is successful
                        
                        // if redock to new row is failed
                        if( vRow2.GetSize() > 0 )
                        { // try swapping - 2nd attempt
                              CRect wrDockBar;
                              pOuterDocker->GetWindowRect( &wrDockBar );
                              CRect rcAnalyze( rcAllRow2 );
                              if( bHorzDockBar )
                              {
                                    rcAnalyze.left = wrDockBar.left;
                                    rcAnalyze.right = wrDockBar.right;
                              } // if( bHorzDockBar )
                              else
                              {
                                    rcAnalyze.top = wrDockBar.top;
                                    rcAnalyze.bottom = wrDockBar.bottom;
                              } // else from if( bHorzDockBar )
                              if( nMoveUpDownDirection < 0 )
                              {
                                    rcAnalyze.OffsetRect(
                                          bHorzDockBar ? 0 : (rcAllRow.right - rcAllRow2.right),
                                          bHorzDockBar ? (rcAllRow.bottom - rcAllRow2.bottom) : 0
                                          );
                              } // if( nMoveUpDownDirection < 0 )
                              else
                              {
                                    rcAnalyze.OffsetRect(
                                          bHorzDockBar ? 0 : (rcAllRow2.right - rcAllRow.right),
                                          bHorzDockBar ? (rcAllRow2.bottom - rcAllRow.bottom) : 0
                                          );
                              } // else from if( nMoveUpDownDirection < 0 )
                              if( !rcAnalyze.PtInRect(ptTrack) )
                              {
m_pExtBarSrc->_AffixmentRecalcOuter();
                                    _DoFixed_StaticOuterRowSwap(
                                          vRow2[0],
                                          vRow[0]
                                          );
                                    _DoFixed_StaticMinimalDockSiteRecalc(
                                          m_pExtBarSrc->m_pDockSite,
                                          pOuterDocker
                                          );
                                    return true;
                              } // if( !rcAnalyze.PtInRect(ptTrack) )
                        } // try swapping - 2nd attempt
                  } // if( vRow2.GetSize() != 0 )
            } // else from if( bSwap || bSwapXtra )
      } // if( nMoveUpDownDirection != 0 )
//    if( bSwap )
//          return true;

      // do slide
CRect rcBar;
      m_pExtBarSrc->GetWindowRect( &rcBar );
      pOuterDocker->ScreenToClient( &rcBar );
int nOffsetInRowActual = bHorzDockBar
            ? rcBar.left
            : rcBar.top
            ;
CPoint ptShifted( ptTrack - sizeOffset );
      pOuterDocker->ScreenToClient( &ptShifted );
int nOffsetInRowDesired = bHorzDockBar
            ? ptShifted.x
            : ptShifted.y
            ;
int nShiftDesired = nOffsetInRowDesired - nOffsetInRowActual;

BOOL bLayoutQueryOld = pOuterDocker->m_bLayoutQuery;
CRect rectLayoutOld( pOuterDocker->m_rectLayout );
      pOuterDocker->m_bLayoutQuery = FALSE;
      pOuterDocker->GetWindowRect( &pOuterDocker->m_rectLayout );
      pOuterDocker->m_rectLayout.OffsetRect(
            - pOuterDocker->m_rectLayout.TopLeft()
            );
bool bInplaceResizing = false;
//    if( m_pExtBarSrc->IsFixedMode() ) // (+ v.2.22)
      if( m_pExtBarSrc->IsFixedDockStyle() ) // (+ v.2.22)
      {
            InternalAffixmentData * pAffixmentData =
                  m_pExtBarSrc->_AffixmentGetOuter();
            if( pAffixmentData != NULL )
            {
                  if(         (! pAffixmentData->IsEmpty() )
                        &&    (! m_pExtBarSrc->_GetFullRowMode() )
                        )
                  {
                        bool bInitialRecalcAffixment = false;
                        if( (pAffixmentData->m_dwAffixmentFlags & InternalAffixmentData::__EAFF_FIXED_MODE_INITIAL_RECALC) != 0 )
                              bInitialRecalcAffixment = true;
                        else
                        {
                              CRect rcOuterDocker;
                              pOuterDocker->GetClientRect( &rcOuterDocker );
                              ASSERT( rcOuterDocker.left == 0 && rcOuterDocker.top == 0 );
                              if(         (bHorzDockBar && pAffixmentData->m_rcAffixment.Width() >= rcOuterDocker.right)
                                    ||    (bHorzDockBar && pAffixmentData->m_rcAffixment.Height() >= rcOuterDocker.bottom)
                                    )
                                    bInitialRecalcAffixment = true;
                        } // else from if( (pAffixmentData->m_dwAffixmentFlags & InternalAffixmentData::__EAFF_FIXED_MODE_INITIAL_RECALC) != 0 )
                        if( bInitialRecalcAffixment )
                        {
                              pAffixmentData->Empty(); // initial recalc
                              pAffixmentData->m_dwAffixmentFlags &=
                                    ~(InternalAffixmentData::__EAFF_FIXED_MODE_INITIAL_RECALC);
                        } // bInitialRecalcAffixment
                  }
                  if( pAffixmentData->IsEmpty() )
                        pOuterDocker->_AffixmentBringToTop( m_pExtBarSrc );
            } // if( pAffixmentData != NULL )
      } // if( m_pExtBarSrc->IsFixedMode() ) // (+ v.2.22)
      pOuterDocker->_RedockInRow(
            m_pExtBarSrc,
            nShiftDesired,
            &bInplaceResizing
            );
      pOuterDocker->m_bLayoutQuery = bLayoutQueryOld;
      pOuterDocker->m_rectLayout = rectLayoutOld;

      if( bInplaceResizing )
      {
            g_DragStateOld.SetCFR(
                  bHorzDockBar ? __ECFR_HORZ : __ECFR_VERT
                  );
      } // if( bInplaceResizing )

      CExtPaintManager::stat_PassPaintMessages();
      return true;
}

Suhai Gyorgy Apr 5, 2007 - 12:50 AM

The symptoms of the first problem are very similar to those that happen when you try to use the ProfUIS library statically linked, but don’t include the ProfUIS resources. To make sure this is not the case, please follow this FAQ How to link statically with Prof-UIS?
If crash still happens, please copy Call stack of crash.

For your Question #1, here’s Support’s answer: CExtControlBar question