CntBar() might get what you want. See the help file entry.
But your question is quite vague.
The error message "Menu has not been defined with Define PopUp" is excruciatingly accurate. It means exactly what it says.
This almost sounds like a code organizational problem. Your code improperly encounters ACTIVATE before DEFINE, or perhaps in a loop something issues RELEASE before the second time through?
It is accurate, its that on app loadup I check some env things before I create/load the menus.
It occurs before the login page at which time there is no menu as it loads different menus based on the user's level. If something is not as expected in the env, (this occurs before the login), I then redirect the user to a "settings" form. Note that this form is loaded in this special case before the login form and before any menus.
This settings form contains licensning data and place to add 3rd party apps, which will build the menu the pads for them. At this point I need to check if the menu or pads exists and branch around it as there is code that builds/updates the menu popups when the user applies the settings.
I know of other ways around this problem such as "do form settings with 'NoMenus'", but was wondering if there was a way to test if menu/popup pad was up or created...
Please accept this with respect. You're going about this in the wrong way, and the errors you're seeing are rubbing your nose in it.
Menus have always been Foxpro's dirty little secret. They work a specific way. They work quite well, exactly the way they work. But stray from the path they expect and they'll make you regret it.
The fact that you're having trouble tells me you're probably writing code by hand, which you shouldn't be doing. Use the menu builder, and also genmenux (
Based on what you said about the login and settings forms, I think your best bet would be to do a minor re-design, so that the menus are created only after a successful login (and only after you know the user's level). I feel sure that would be simpler than your present approach.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
I done it the way I mentioned at the top of this post. I was hoping there was a simple way to use an existance test...
At the top of my main.prg, i created a variable and when calling the form I pass its value to a form variable. If I get to this form from an area where the menus are up, I just change its value. I also had to add code in all the locations that could call this form and set the variable's value accordingly.
If thisform.FromForm <> 'NotLoggedInNoMenu'
Do 'MyAppsMenuPads'
Do 'RdcSitesMenuPads'
Endif
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.