HelpSetOptions Sets Visible Property to False on Wrong Button

ID: Q95942


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SYMPTOMS

The HelpSetOptions function in the Help Toolkit sets the Visible property on the wrong button when passed a Flags parameter greater than 2.


WORKAROUND

To work around the problem, load the HELP.MAK project, change the code in the procedure HelpSetOptions as shown below. To rebuild HELP.QLB and HELP.LIB, from the Run menu, choose Make Library.

Change: If (Flags AND 2 ^ (i + 3)) = FALSE THEN
to: If (Flags AND 2 ^ (i + 2)) = FALSE THEN


STATUS

Microsoft has confirmed this to be a bug in the Professional Edition of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

The flags parameter to the HelpSetOptions procedure is a bitwise value controlling the Visible status of the five command buttons on the help button bar and also controls two other options. The following table shows the values to set these options.


  Function                  Value   Default
  ------------------------------------------------------------------------
  ESC closes Help             1     0 (ESC key does not close help window)
  UNLOAD Help at Form close   2     0 (Help form made invisible, not
                                       unloaded when form is closed)
  No Contents Button          4     0 (Contents button is visible)
  No Search Button            8     0 (Search button is visible)
  No Back Button             16     0 (Back button is visible)
  No History Button          32     0 (History button is visible)
  No Copy Button             64     0 (Copy button is visible) 

Steps to Reproduce Problem

  1. Invoke VBDOS.EXE with the HELP.QLB Quick library by typing the following at the command prompt:
    VBDOS /L HELP.QLB


  2. From the File menu, choose New Form (ALT, F, F). Form1 is created by default.


  3. From the Window menu, choose Menu Design Window (ALT, W, M).


  4. Create a top level menu with the following properties:
    Caption = &Help
    CtlName = mHelp


  5. Create a sub-menu item under &Help with the following properties:
    Caption = &Contents
    CtlName = mHelpContents


  6. Press the Done button (ALT+D) to close the Menu Design Window.


  7. From the File menu, choose Exit (ALT, F, X). Save all changes.


  8. Add the following code to the module level code of Form1:
    
          Rem $INCLUDE: 'HELP.BI'    ' Load Help include file
          Dim SHARED HelpLoaded%     ' Flag indicating success of Help load 


  9. Add the following code to the Form_Load event of Form1:
    
          Sub Form_Load ()
             HelpRegister "HELPDEMO.TXT", HelpLoaded%
          End Sub
       HELPDEMO.TXT is a sample help file shipped with Visual Basic. 


  10. Add the following code to the Form_Unload event of Form1:
    
           Sub Form_Unload (Cancel AS INTEGER)
              HelpClose 'So that Help closes the hidden window it leaves up.
           End Sub 


  11. Add the following code to mHelpContents_Click event:
    
           Sub mHelpContents_Click ()
               If HelpLoaded% Then ' Ensure that Help was loaded successfully
                  Flags% = 16 + 64  ' Hide the Back and Copy Buttons
                  HelpSetOptions 3, 0, 7, 0, 7, 11, Flags%
                  HelpshowTopic "Contents"
               End If
           End Sub 


  12. From the Run menu, choose Start (ALT, R, S) to run the program.


  13. From the Help menu, choose Contents.


The Visual Basic for MS-DOS help engine loads and displays the help file HELPDEMO.TXT. Two of the five buttons on the button bar are invisible due to the Flags parameter passed to HelpSetOptions. However, the wrong buttons are invisible. Instead of the Back and Copy buttons being invisible, the Search and History buttons are invisible.

Additional query words: VBmsdos buglist1.00 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 10, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.