Microsoft Knowledge Base Email Alertz

A Web page loads in Internet Explorer 6 instead of in the WebBrowser control when you use an application that hosts the COM version of the WebBrowser control

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 939204 - Last Review: July 3, 2007 - Revision: 1.0

A Web page loads in Internet Explorer 6 instead of in the WebBrowser control when you use an application that hosts the COM version of the WebBrowser control

SYMPTOMS

Consider the following scenario:
  • You have a computer that has Microsoft Internet Explorer 6 installed.
  • You use Microsoft Visual Studio .NET 2005 or Microsoft Visual Studio .NET 2003 to create an application that hosts the Component Object Model (COM) version of the Microsoft WebBrowser control.

    Notes
    • The WebBrowser control is based on the Shdocvw.dll component.
    • The Shdocvw.dll component is in the following folder:
      %systemroot%\System32
  • You use the ActiveX Control Importer tool (Aximp.exe) to generate the interop assemblies for the Shdocvw.dll component.
  • You add references to the application project.

    Note The references are based on the interop assemblies.
  • You use the references to add the WebBrowser control to the application.
  • You use the application to load a Web page in the WebBrowser control.
In this scenario, you may receive a dialog box. The dialog box contains an Open button and a Save button. If you click Open, the Web page is loaded in Internet Explorer 6 instead of in the WebBrowser control.

Note This problem does not occur on a computer that has Windows Internet Explorer 7 installed.

CAUSE

This problem occurs because two Shdocvw.dll files exist on the computer.

When you use Aximp.exe to generate the interop assemblies for the Shdocvw.dll component that is in the %systemroot%\System32 folder, Aximp.exe generates an interop assembly that is named Shdocvw.dll. This interop assembly is located in the executable directory of the application. However, the original Shdocvw.dll component is still present in the %systemroot%\System32 folder. Therefore, two Shdocvw.dll components exist.

This problem occurs if the following conditions are true:
  • When you start the application, the application loads the Shdocvw.dll component that is in the executable directory.
  • The application then loads the Shdocvw.dll component that is in the %systemroot%\System32 folder.

RESOLUTION

To resolve this problem, follow these steps:
  1. Use an IDE to regenerate the interop assemblies for the Shdocvw.dll component.
  2. Redeploy the application.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about Aximp.exe, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/8ccdh774(VS.80).aspx (http://msdn2.microsoft.com/en-us/library/8ccdh774(VS.80).aspx)
For more information about this problem, click the following article numbers to view the articles in the Microsoft Knowledge Base:
306718  (http://kbalertz.com/Feedback.aspx?kbNumber=306718/ ) Running Tlbimp.exe or Aximp.exe on Shdocvw.dll in the users Documents and Settings folder causes Internet Explorer and Windows Explorer to stop functioning
325618  (http://kbalertz.com/Feedback.aspx?kbNumber=325618/ ) Name collision in the ActiveX wrapper class

APPLIES TO
  • Microsoft Internet Explorer 6.0
Keywords: 
kbexpertiseadvanced kbtshoot kbprb KB939204
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate