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 » Cell Tooltip Problem Collapse All
Subject Author Date
Krustys Donuts May 21, 2008 - 5:09 PM

Dear Support,


 


I am trying to implement tooltips for cells by using your suggestion from the May 14, 2007 - 3:39 AM thread. So far, I have the OnInitToolTip method being called in my class derived from CExtGridCellNumber. In this routine, the call to wndToolTip.AddTool() is made properly. The problem is that I never see the tooltip on the interface. Any help would be appreciated.

I have made the suggested calls:



EnableTooltips(


EnableExpanding(


SiwModifyStyleEx( __EGBS_EX_CELL_TOOLTIPS, 0, false);->m_nAdvancedTipStyle = CExtPopupMenuTipWnd::__ETS_NONE;


this


true, true, true, true, true);false, false, false, false, false);

Krustys Donuts May 27, 2008 - 5:20 PM

After inserting the suggested code into InitInstance, my program Asserts in the following routine, after called.


TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC); is



HWND CDataExchange::PrepareCtrl(


{


ASSERT(nIDC != 0);


ASSERT(nIDC != -1);


int nIDC)// not allowed

HWND hWndCtrl;


COleControlSite* pSite = NULL;


m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);


 


{


 


if (hWndCtrl == NULL)// Could be a windowless OCX

pSite = m_pDlgWnd->GetOleControlSite(nIDC);


 


{


TRACE(traceAppMsg, 0,


ASSERT(FALSE);


AfxThrowNotSupportedException();


}


}


m_idLastControl = nIDC;


m_bEditLastControl = FALSE;


if (pSite == NULL)"Error: no data exchange control with ID 0x%04X.\n", nIDC);// not an edit item by default

 


}


 


Also, upon further investigation, I can see were m_ctrlShadow.DestroyWindow is being called even though the value for m_ctrlShadow is NULL. This call takes place in the following routine:



void


{


 


CExtPopupMenuTipWnd::Hide()//ASSERT_VALID( this );

 


{


KillTimer( ID_TIMER_DELAY_SHOW );


KillTimer( ID_TIMER_DELAY_KILL );


KillTimer( ID_TIMER_LIFE_STEP );


KillTimer( ID_TIMER_ANIMATION );


SetWindowPos(


NULL, 0, 0, 0, 0,


SWP_HIDEWINDOW|SWP_NOSENDCHANGING


|SWP_NOSIZE|SWP_NOMOVE


|SWP_NOZORDER|SWP_NOOWNERZORDER


|SWP_NOACTIVATE|SWP_NOCOPYBITS


);


if( GetSafeHwnd() != NULL )

// CWnd * pWnd = GetParent();


// CExtPopupMenuWnd * pPopup =


// DYNAMIC_DOWNCAST(


// CExtPopupMenuWnd,


// pWnd


// );


// for( ; pPopup != NULL; pPopup = pPopup->GetParentMenuWnd() )


// pPopup->_DelayPaint();



}


m_rcExcludeArea.SetRectEmpty();


m_shadow.Destroy();


 


m_ctrlShadow.DestroyWindow();


}


if( m_ctrlShadow.GetSafeHwnd() != NULL )

Any suggestions?


Gil


return hWndCtrl;

Technical Support May 28, 2008 - 12:11 PM

Here is the current version of the CExtPopupMenuTipWnd::Hide() method and we believe there are no problems with it:

void CExtPopupMenuTipWnd::Hide()
{
      if( GetSafeHwnd() != NULL )
      {
            KillTimer( ID_TIMER_DELAY_SHOW );
            KillTimer( ID_TIMER_DELAY_KILL );
            KillTimer( ID_TIMER_LIFE_STEP );
            KillTimer( ID_TIMER_ANIMATION );
            SetWindowPos(
                  NULL, 0, 0, 0, 0,
                  SWP_HIDEWINDOW|SWP_NOSENDCHANGING
                        |SWP_NOSIZE|SWP_NOMOVE
                        |SWP_NOZORDER|SWP_NOOWNERZORDER
                        |SWP_NOACTIVATE|SWP_NOCOPYBITS
                  );
      }
      m_rcExcludeArea.SetRectEmpty();
      m_shadow.Destroy();
      if( m_ctrlShadow.GetSafeHwnd() != NULL )
            m_ctrlShadow.DestroyWindow();
}
As for the DDX related assertion failure , we believe it happens because your dialog or form view class contains some subclassed property for some control which does not exist in the dialog template resource. Please check all the lines in the DoDataExchange() virtual method of your dialog or form view class and check whether each line contains the dialog control identifier of really existing control in the corresponding dialog template resource.

Krustys Donuts May 23, 2008 - 11:01 AM

At this point my tooltips seem to be functioning fine with one exception. When I move the cursor from one cell that produces a tooltip directly to another cell that produces a tooltip, my program Asserts. Below is the call stack and the function which causes the assertion.


 


 > mfc80d.dll!CWnd::DestroyWindow()  Line 1013 + 0x1e bytes C++

  ProfUIS282md.dll!CExtPopupMenuTipWnd::Hide()  Line 7466 + 0x19 bytes C++

  ProfUIS282md.dll!CExtPopupMenuTipWnd::Show(CWnd * pWndParent=0x0c346360, const tagRECT & rcExcludeArea={...}, bool bNoDelay=false, void * & hPassiveModeDWP=0x00000000)  Line 7075 + 0x12 bytes C++

  ProfUIS282md.dll!CExtPopupMenuTipWnd::Show(CWnd * pWndParent=0x0c346360, const tagRECT & rcExcludeArea={...}, bool bNoDelay=false)  Line 666 + 0x22 bytes C++

  ProfUIS282md.dll!CExtGridBaseWnd::OnAdvancedPopupMenuTipWndDisplay(CExtPopupMenuTipWnd & _ATTW={...}, const tagRECT & rcExcludeArea={...})  Line 11379 C++

  ProfUIS282md.dll!CExtGridWnd::OnGbwTooltip(const CExtGridHitTestInfo & htInfo={...})  Line 54787 + 0x1a bytes C++

  ProfUIS282md.dll!CExtGridBaseWnd::OnGbwHoverRecalc(const tagPOINT * pPtClient=0x0012fab8)  Line 9359 + 0x19 bytes C++

  ProfUIS282md.dll!CExtGridBaseWnd::OnMouseMove(unsigned int nFlags=0, CPoint point={...})  Line 8764 + 0x16 bytes C++

  mfc80d.dll!CWnd::OnWndMsg(unsigned int message=512, unsigned int wParam=0, long lParam=6029599, long * pResult=0x0012fc04)  Line 2169 C++

  mfc80d.dll!CWnd::WindowProc(unsigned int message=512, unsigned int wParam=0, long lParam=6029599)  Line 1741 + 0x20 bytes C++

  ProfUIS282md.dll!CExtScrollWnd::WindowProc(unsigned int message=512, unsigned int wParam=0, long lParam=6029599)  Line 3437 C++

  ProfUIS282md.dll!CExtGridBaseWnd::WindowProc(unsigned int message=512, unsigned int wParam=0, long lParam=6029599)  Line 11285 C++

  mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x0c346360, HWND__ * hWnd=0x002e09a2, unsigned int nMsg=512, unsigned int wParam=0, long lParam=6029599)  Line 240 + 0x1c bytes C++


 


 


 



BOOL CWnd::DestroyWindow()


{


CWnd* pWnd;


CHandleMap* pMap;


HWND hWndOrig;


BOOL bResult;


 



if ((m_hWnd == NULL) && (m_pCtrlSite == NULL))return FALSE;if (m_hWnd != NULL)

#ifdef


hWndOrig = m_hWnd;


_DEBUG

#endif



}



#ifdef


 


bResult = ::DestroyWindow(m_hWnd);


_AFX_NO_OCC_SUPPORTif (m_hWnd != NULL)

#else


//_AFX_NO_OCC_SUPPORT

 


{


 


bResult = ::DestroyWindow(m_hWnd);


 


if ((m_hWnd != NULL) || (m_pCtrlSite != NULL))if (m_pCtrlSite == NULL)else

bResult = m_pCtrlSite->DestroyControl();


}



#endif


//_AFX_NO_OCC_SUPPORT

 


{


 


if (hWndOrig != NULL)// Note that ’this’ may have been deleted at this point,

 


// (but only if pWnd != NULL)

 


{


 


if (pWnd != NULL)// Should have been detached by OnNcDestroy

#ifdef


ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);


_DEBUG

#endif



}


 


else

{



#ifdef


ASSERT(m_hWnd == hWndOrig);


_DEBUG

#endif



 


// Detach after DestroyWindow called just in case

Detach();


}


}


 


}


return bResult;


 


bResult = FALSE;


pMap = NULL;


pWnd = NULL;


hWndOrig = NULL;


 


{


pMap = afxMapHWND();


ENSURE(pMap != NULL);


pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);

Technical Support May 23, 2008 - 1:57 PM

This assertion looks like an incorrect MFC state switching problem. You have MFC based EXE projects and if you have MFC based regular DLL and/or ActiveX components used in EXE and some of them do not have the AFX_MANAGE_STATE( AfxGetStaticModuleState() ); code invoked everywhere it should be, the tooltips and content expand windows implemented in Prof-UIS can generate assertion failures similar to those described in your message. Although this problem should be fixed in each particular MFC regular DLL and ActiveX projects, you can also make Prof-UIS forcibly switch the MFC state to the MFC copy used by both Prof-UIS and your main EXE which can also prevent these assertion failures . You should invoke the following code in the InitInstance() virtual method of your CWinApp-derived class to make Prof-UIS switch the MFC state to the EXE-related copy of MFC:

CExt_ProfUIS_ModuleState::InitExtension( AfxGetAppModuleState() );

Technical Support May 22, 2008 - 12:20 PM

The grid cell tooltips in old Prof-UIS versions were based on the CToolTipCtrl window and CExtGridCell::OnInitToolTip() virtual method. The current version is based on a CExtPopupMenuTipWnd advanced tooltip window and CExtGridCell::OnInitAdvancedTip() virtual method. You can switch to advanced tooltips and implement the CExtGridCell::OnInitAdvancedTip() virtual method. If you like classic tooltips based on the CExtGridCell::OnInitToolTip() virtual method, you should override the CExtGridBaseWnd::OnAdvancedPopupMenuTipWndGet() virtual method in your grid class and simply return NULL.