"Menu Bar Longer Than Screen!" Without MenuInit in UI Toolbox (71791)



The information in this article applies to:

  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q71791

SUMMARY

When you use the User Interface (UI) Toolbox menu functions, if you don't properly initialized the menus, the message "Menu bar longer than screen! Cannot continue!" will display.

To avoid this error, be sure to call "MenuInit" before running any other menu commands.

This information applies to the User Interface Toolbox of Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS.

MORE INFORMATION

The following program demonstrates how the error can be generated:

Code Sample

'$INCLUDE: 'general.bi'
'$INCLUDE: 'mouse.bi'
'$INCLUDE: 'window.bi'
'$INCLUDE: 'menu.bi'

COMMON SHARED /uitools/ GloMenu           AS MenuMiscType
COMMON SHARED /uitools/ GloTitle()        AS MenuTitleType
COMMON SHARED /uitools/ GloItem()         AS MenuItemType
COMMON SHARED /uitools/ GloWindow()       AS windowType
COMMON SHARED /uitools/ GloButton()       AS buttonType
COMMON SHARED /uitools/ GloEdit()         AS EditFieldType
COMMON SHARED /uitools/ GloStorage        AS WindowStorageType
COMMON SHARED /uitools/ GloWindowStack()  AS INTEGER
COMMON SHARED /uitools/ GloBuffer$()

DIM GloTitle(MAXMENU)           AS MenuTitleType
DIM GloItem(MAXMENU, MAXITEM)   AS MenuItemType
DIM GloWindow(MAXWINDOW)        AS windowType
DIM GloButton(MAXBUTTON)        AS buttonType
DIM GloEdit(MAXEDITFIELD)       AS EditFieldType
DIM GloWindowStack(MAXWINDOW)   AS INTEGER
DIM GloBuffer$(MAXWINDOW + 1, 2)

' To correct the "Menu bar longer than screen! Cannot continue!"
' error, invoke 'MenuInit' here...
MenuSet 1, 0, 1, "menu", 5
MenuPreProcess
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB71791