FIX: ATL Controls Don't Appear in IE When Initially Downloaded
Article ID: 191127
Article Last Modified on 6/28/2001
APPLIES TO
- Microsoft Internet Explorer 4.0 128-Bit Edition
- Microsoft Internet Explorer 4.01 Service Pack 2
- Microsoft ActiveX Template Library 2.0, when used with:
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft ActiveX Template Library 2.1, when used with:
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft ActiveX Template Library 3.0, when used with:
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q191127
SYMPTOMS
If an ActiveX Template Library (ATL) control is downloaded from a Web page,
the ATL control may not appear initially. Clicking on the Refresh button in
Internet Explorer causes the control to appear.
CAUSE
This is a bug in Internet Explorer. It is not calling the control's
IViewObject::Draw() function after the control is downloaded and
registered.
RESOLUTION
Force the control to redraw itself when it is inplace-activated. You can do
this by overriding the DoVerbInPlaceActivate() function in your CComControl-
derived class:
HRESULT DoVerbInPlaceActivate(LPCRECT prcPosRect, HWND hwndParent)
{
HRESULT hr =
IOleObjectImpl<CMyControl>::DoVerbInPlaceActivate(prcPosRect,
hwndParent);
FireViewChange();
return hr;
}
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been corrected in Visual
C++, 6.0.
Keywords: kbbug kbfix KB191127