PRB: ToolTips for Controls in ActiveX Document Server Are Hidden by the ActiveX Document Container (247382)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q247382 SYMPTOMS
To add ToolTips for controls in the ActiveX Document server, you can use the Microsoft Foundation Classes (MFC) default implementation by calling the EnableToolTips function, which works correctly. However, for more flexible functionality of the ToolTip, you can also use the CTooltipCtrl class to create your own ToolTip control object. If the ToolTips are created by using the CTooltipCtrl class, it is not shown in the ActiveX Document Container.
CAUSE
When the user calls the server from the document container, the main frame window is the container's frame window, (that means that the window procedure is a different window procedure). Thus, it mixes up the z-order of the windows. However, although the ToolTip window is actually being shown, it is hidden behind the window of the server.
RESOLUTION
To work around the problem, set the z-order of the ToolTips to the topmost level after creating the ToolTips.
This sample code illustrates the workaround:
void CTestView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
ResizeParentToFit();
CButton * mButton = (CButton *)GetDlgItem(IDC_BUTTON1);
if( !m_tooltip.Create(this,TTS_ALWAYSTIP))
TRACE(_T("Unable to Create ToolTip"));
else if( !m_tooltip.AddTool( mButton, "Show the tooltips"))
TRACE(_T("Unable to add tip for the control window"));
else
{
m_tooltip.SetWindowPos(&wndTopMost,0,0,0,0,SWP_SHOWWINDOW|
SWP_NOSIZE |SWP_NOMOVE);
m_tooltip.Activate(TRUE);
}
}
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/11/2003 |
---|
Keywords: | kbActiveDocs kbCmnCtrls kbContainer kbprb kbToolTip KB247382 |
---|
|