Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Top-level Error ... Again
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00301095
Message ID:
00301132
Vues:
52
>>Ok guys ... I know you're not ignoring me. :-) But I posted this question a couple days ago and have gotten zero responses. Since I'm sure someone out there has either seen this or sees what I'm missing, I'm posting it again to cajole you all into uncovering the mystery for me:
>>
>>I have instantiated menus in top-level forms 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. The form is a top-level, of course.
>>
>>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
>>
>
>I use TLs a lot, but you're doing something I haven't done here with the SYSMENU involvement. First thought, though probably you've checked, have you NULLified the oApp prop? Also, I use a form prop for the second WITH param (I forget why, there was some problem, I think, a long while ago).

Well, the SYSMENU stuff is to get the hotkeys to work. I don't know why, but a while back I had a dialog with Vladimer Schevchenko (SP?) on this issue and we ( or probably he ) determined that after instantiation of the top-level menu, issuing the SET SYSMENU OFF then SET SYSMENU AUTOMATIC, the hotkeys would start working, and they do, why ... I don't know.

I do not NULL the oApp prop, but all it contains is a string containing the name of the menu created by GENMENU so you can reference it later, ostensibly to release it. But at your bidding, I will try it. :-) As a test I'll also try moving the property from oApp to the form to see what happens.

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

Click here to load this message in the networking platform