Microsoft KB Archive/223088

= FIX: WhatsThis Help Does Not Work in UserDocs =

Article ID: 223088

Article Last Modified on 5/30/2006

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 4.01 Service Pack 1
 * Microsoft Internet Explorer 4.01 Service Pack 2

-



This article was previously published under Q223088



SYMPTOMS
A form contains the WebBrowser control used to display an ActiveX Document. The WhatThisHelp and WhatsThisButton properties are set to True. When you run the project, the WhatThisButton does not display the Help topic associated with the ActiveX Document. The expected behavior is for the appropriate topic from the Help file to appear.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed



MORE INFORMATION
This section shows you how to create a Visual Basic project that demonstrates the bug behavior. The section assumes you have a Windows Help file and are familiar with the following tasks:


 * Creating and compiling ActiveX Documents created with Visual Basic.
 * Using the WebBrowser Control shipped with Internet Explorer.
 * Using ActiveX controls in Visual Basic.

If you are not familiar with these tasks, see the REFERENCES section of this article for more information.

To create the project, do the following:
 * 1) Create and compile an ActiveX document DLL.
 * 2) Create a Standard EXE project to contain the WebBrowser control used to display the ActiveX document.

Create and Compile an ActiveX Document
 Start a new ActiveX Document DLL project in Visual Basic. UserDocument1 is created by default. Add a TextBox control to UserDocument1. In the TextBox property sheet, set the WhatsThisID property to the topic number of your Help file.  Copy the following code to the Code window of Form1. Add the name of the Help file to the appropriate line: Option Explicit

Private Sub UserDocument_Initialize App.HelpFile = App.Path & "" End Sub  Save the project as UserDocument.vbp. Compile the project into the file UserDocument.dll. Close the ActiveX Document project.</li></ol>

After you create the ActiveX Document DLL file, you can create the Standard EXE file that demonstrates the bug behavior.

Create a Standard EXE Project
<ol> Start a new Standard EXE project in Visual Basic. Form1 is created by default.</li> Add the Microsoft Internet Controls to the project. For more information about adding ActiveX controls to your project, see the REFERENCES section of this article.</li> Add a WebBrowser Control project to your Standard EXE project. WebBrowser1 is created by default.</li> In the Form1 property sheet, set the following properties: <ul> BorderStyle=3-Fixed Dialog</li> WhatsThisButton=True</li> WhatsThisHelp=True</li></ul>

</li>  Copy the following code to the Code window of Form1. Add the Help file name to the appropriate line: Option Explicit

Private Sub Form_Load App.HelpFile = App.Path & "<Help File Name>" WebBrowser1.Navigate App.Path & "\UserDocument1.vbd" End Sub </li> On the Run menu, select Start, or press the F5 key to start the program. The ActiveX Document appears in the WebBrowser control. In the Title Bar of Form1, click the Help button. The cursor changes to a question mark. Click the ActiveX Document in the WebBrowser control.

BUG: The appropriate topic from the Help file does not appear. The expected behavior is for the appropriate topic to appear.</li></ol>

<div class="references_section">