Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Top-Level Error
Message
De
07/12/1999 07:44:31
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Titre:
Top-Level Error
Divers
Thread ID:
00299672
Message ID:
00299672
Vues:
44
I have instantiated menus in top-level form often w/o problems. But recently in a top-level I'm having a problem with the infamous "This menu can only be called from a Top-Level Form ..." error.

When running in development, I can run the application and the menu will instantiate properly. If I then close the application and re-run it I get the error. I have noted that issuing a CLEAR PROGRAM before re-running the application "fixes" it.

The menu is being instantiated in the form Init with the following code:
lcMyMenu = ''
DO Main.mpr WITH THISFORM, lcMyMenu
WITH oApp     && oApp is application object
    .MenuName = lcMyMenu && Store menu name for release later
    .ConfigureMenu()     && Sets up Cut, Copy and Paste functionality
ENDWITH
SET SYSMENU OFF       && These 2 statements are required after instantiating
SET SYSMENU AUTOMATIC && the top-level menu to get the hotkeys to work
The menu and "Edit" popup are being released in the form Destroy with the following code:
RELEASE POPUPS Edit EXTENDED
RELEASE MENUS (oApp.MenuName) EXTENDED
After running and closing the application, a DISPLAY MEMORY verifies that the menu and popup have been released. Something simple is slipping thru the crack here ... but I'm missing it.

Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Répondre
Fil
Voir

Click here to load this message in the networking platform