Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Errors 2

Status
Not open for further replies.

gaps

Programmer
Jun 4, 2004
8
US
Hello,

I have trouble using different menus with different forms. I am using VFP
8.0 SP1

1) Main form has top level menu name 'main'.
2) Second form is MDI has menu 'order' called when form is called & release
when form is release .

Problem#1 with Method 1

When second form is called, Main menu is deactivated when lost focus &
activated when got focus. Problem is it's change position of menu & first
bar can't be accessed because of icon place from second form.

Problem#2 with Method 2

When second form is called, Main menu is released using 'Release Menu "
command, when lost focus & called using 'do main.mpr' when got focus.
Problem is after few uses, got an error "Not enough Memory to complete this
operation'.

Problem#3 with Method 3

When second form is called, Main menu is released using 'Release Menu
Extended " command, when lost focus & called using 'do main.mpr' when got
focus. Problem is after few uses, got an error "Menu Manager internal
consistency Error'.


I tried all commands related to menu, but no success.

Please suggest me best solutions to use different menus with different forms
in one program.

I wonder why menu system in VFP is so complicated, compare to VB.

TIA

Jit
 
Is your 'main' form a Top-Level form? If so in order to load your form menu you use (According to the Help file):

Code:
DO menuname.mpr WITH oForm, lAutoRename

when lost focus & called using 'do main.mpr' when got focus.

So, shouldn't the re-activation of the Top-Level menu be in the same fashion as shown above?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks for Reply

Will you explain in detail please?
Main form is set to AS TOP LEVEL FORM & I called menu DO MAIN.MPR WITH THIS.

Getting error is a problem.

Thanks Again

Jit
 
Gaps

Will you explain in detail please?

when lost focus & called using 'do main.mpr' when got focus.

Shouldn't the above code have the parameter refering to the form as well?




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
GAPS

Just to support what Mike is saying, look at the following example code
Code:
[COLOR=blue]LOCAL lcGetMenuName

lcGetMenuName = []
DO main.mpr WITH THIS, [b]lcGetMenuName[/b][/color]
You'll see the code you have posted does not have a second parameter unlike the examples posted by Mike and myself.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].com
PDFcommander[sup]tm[/sup].co.uk


 
Thanks, Mike & Chris

I got it now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top