RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
Back to the top
1. Create a MFC Document/View application with CHtmlView as the base class for the application view.
2. Turn On and use an Active Accessibility Client application like Magnifier. Clients may also include accessibility aids, automated testing tools, and some computer-based training applications.
Back to the top
Your application may stay running without a window (and be listed in Task Manager) even after it has been closed.
Back to the top
CFormView is the base class for CHtmlView which enables the Active Accessibility support for the application by calling EnableActiveAccessibility() in the class constructor. This in turn creates accessible interface objects responsible to communicate with the client application. The problem created by CHtmlView, unlike other CFormViews, is that it bypasses the cleanup for active accessibility thus causing the application to stay loaded. This can be clearly seen by overriding CHtmlView:OnDestroy() which by default does nothing.
We have also seen that the implementation of the Magnifier (magnify.exe) in Windows versions prior to Vista will not always release references to the accessibility objects.
Back to the top
There are two known workarounds for this issue. Use either one, according to your needs or preferences:
1. Override the CHtmlView-derived class OnDestroy handler to call CFormView::OnDestroy() and post a WM_QUIT to the main thread by calling PostQuitMessage().
void CTestHtmlView::OnDestroy()
{
     CFormView::OnDestroy();
     PostQuitMessage(0);
}
2. Override the CHtmlView derived class OnDestroy handler to release the Active Accessibility objects and post a WM_QUIT to the main thread by calling PostQuitMessage().Â
void CTestHtmlView::OnDestroy()
{
     if (m_pProxy != NULL)
     {
           m_pProxy->SetServer(NULL, NULL);
           m_pProxy = NULL;
     }
     if (m_pStdObject != NULL)
     {
           m_pStdObject->Release();
           m_pStdObject = NULL;
     }
     PostQuitMessage(0);
}
Back to the top
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALSâ€) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Back to the top