SAMPLE: Menuprob.exe MENU() Malfunctions With Top-Level Forms

Last reviewed: February 19, 1998
Article ID: Q172077
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a

SUMMARY

Menuprob.exe is a sample that shows how the Menu() function malfunctions with Top-Level forms.

STATUS

Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The sample files can be extracted from the following file, available for download from the Microsoft Software Library:

 ~ Menuprob.exe (size: 22027 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

As described in the generated menu code when a menu is generated to be used in a Top-Level form, there is a second parameter that can be passed in the DO mymenu.mpr WITH THIS,.T. command that renames the Name property of the form and hence the menu. Running the attached files shows that this is working properly but for some reason, the menu name seems to be cached so the MENU() function does not find the correct menu name in all circumstances. Specifically, when the MENU() function is called from a submenu, MENU() in another instance of the form returns the menu name from the instance of the form where MENU() was called from the submenu. Calling MENU() twice from a menu pad, as opposed to a submenu option, resets MENU() so it returns the correct menu name again.

Steps to Reproduce Behavior

  1. Copy Menuprob.exe to a directory on your system and run it to extract the sample files

  2. Execute "DO FORM Menuprob.scx" command and follow the instructions on the form that appears.

  3. Open the generated menu program for more information on using menus in Top-Level(SDI) forms.

          MODIFY COMMAND Menuprob.mpr
    

Keywords          : FxtoolMBuilder vfoxwin
Version           : WINDOWS:5.0,5.0a
Platform          : WINDOWS
Issue type        : kbhowto
Solution Type     : kbfile


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.