Microsoft KB Archive/191127

= 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</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li> Microsoft ActiveX Template Library 2.1, when used with:  Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 <li>Microsoft Visual C++ 5.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li> <li>Microsoft ActiveX Template Library 3.0, when used with: <ul> <li>Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

<ul> <li>Microsoft Visual C++ 4.2 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

<ul> <li>Microsoft Visual C++ 5.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q191127

<div class="symptoms_section">

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.

<div class="cause_section">

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.

<div class="resolution_section">

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; }

<div class="status_section">

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.

<div class="moreinformation_section">

MORE INFORMATION
This problem does not occur for windowed controls or if the control supports IQuickActivate.

Steps to Reproduce Behavior
<ol> <li>Create an Internet Explorer control using the ATL Object Wizard.</li> <li>Unregister this DLL from the Registry (for example, "regsvr32 /u myctrl.dll")</li> <li> In the HTML page that the Wizard generates, add the CODEBASE tag to the OBJECT tag to point to the DLL you generated, for example: <OBJECT ID="MyCtl" CLASSID="CLSID:E84DD540-BF7A-11D1-8F38-00C04F9403C2" CODEBASE="myctrl.dll"> </li> <li>Open the HTML page in Internet Explorer.</li></ol>

Keywords: kbbug kbfix KB191127

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.