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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form + Menus = garbage in call stack

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US
Hello all,

I have a MAIN.Prg that calls a form called MAIN.scx and inside the MAIN form is a menu. The main form has a pageframe called pgfStaging.

The menu is replacing main.pgfStaging.blah.blah with _2ym0ii1vu.pgfStaging.blah.blah. This "_2ym0ii1vu" is random each time I build the exe and is messing up my debugging breakpoints.


98d880e6ee5cbc52f91d64106ad0217b2g.jpg



I know when the exe is built the menu gets regenerated but my question is, is there a way to keep the "_2ym0ii1vu" the same and or name them something more meaningful? I do not usually use menus and any help would be appreciated.

Thanks, Josh
 
I think I would try renaming the form - in case the wrong object is getting addressed?

Call it frmMain or something like that - then try again.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Josh,

Generate the menu from within the menu designer, and place the generated files (MNX and MNT files) in the project. That way, VFP won't have to regenerate the menu everytime you do a build, and won't assign a different name each time.

You'll still get auto-generated names for the menu bars (not for the menu itself), but, if that's a problem, you can always enter your own pad names in the menu designer (in the Prompt Options dialogue).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Hi guys,

Griff - that did not work.

Mike - I added my own pad names. No luck.

Thanks for the input.

Josh
 
Josh,

Can we clarify this.

First, you say the menu is "inside" the main form. What do you mean by that? As a rule, menus are separate from forms. What code are you using to launch the menu?

Also, from what I can see of your call stack, there is no menu present. It looks like the main program has called the form with the pageframe; you clicked on a button in the pageframe to open another form, then clicked on a button in that form. Where does the menu come in?

If there was a menu in your call stack, I'd expect to see ON SELECTION BAR in there somewhere.

If you could clarify these points, we can have another shot at solving the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
The main form has a menu present and I call it this way inside the MAIN.INIT()

Code:
DO MENUS\menu1.mpr WITH THISFORM,.T.

And Mike you are correct with the sequencing.
The puzzling part is the menu is not accessed in that sequence.

 
Are you sure it's the menu doing this? Is it possible that you have a form manager of some kind that's assigning random names to forms when you run them?

Tamar
 
Hi,
How did you make your menu?
Would you be able to post the menu1.mpr here? It also puzzles me why you did not include the directory Menu into your path, any reason for that?

Regards,
Jockey(2)
 
Hi Jockey2,

I created the menu by doing File->New->Menu->New File->Menu and went from that.

What do you mean by "the directory Menu in your path"?
 
Hi,

I am still interested to read your coding to find a reasonable answer for this nondefault behavior.

directory thing, not important, just noticed you activate your menu with DO MENUS\menu1.mpr WITH THISFORM,.T. no big deal but to my opinion if you have the directory MENUS in your path you could do with only DO menu1.mpr WITH etc..

Regards,

Jockey(2)
 
Josh,

I see it's been a couple of weeks since you first posted your question, and you haven't yet got a solution. Part of the reason for that might be that you haven't followed up some of the suggestions that have been made.

In particular, a couple of us made the point that it appears to be something other than the menu that's causing this problem - at least, judging by the code in the screen shot of your calling stack.

It would be really helpful if you could confirm that the menu is causing the problem - or not. One way of doing that would be to eliminate the menu from the form, and see what difference that makes.

Also, I wonder why this is really an issue. In general, internally-generated names don't cause a problem. You say that it is messing up your breakpoints. But breakpoints are only temporary expedients used during debugging. If you are setting a breakpoint that involves a menu name (which seems unlikely) to find a particular bug, maybe you need to find some other way of solving that bug.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Sorry all,
My workdays have been packed and I have not been able to try the above suggestions.

When there is a lull I will get back to this.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top