Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menu bars disabled--redux
Message
From
21/11/2009 03:51:09
 
 
To
20/11/2009 10:46:44
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01435795
Message ID:
01435915
Views:
53
>I've finally come up with a reproducible scenario for the menu bars disabling. (Original message: #1432959)
>
>I choose a particular menu item, which calls a PRG. That PRG calls an app object method that checks for a particular scenario. If the scenario occurs, it runs a modal form. As you'd expect, when that modal form runs, the menu bars become disabled. One of the choices that the user can make from that form leads to a wait state (waiting for some things to happen in COM objects). After that, the form is released, but the menu remains disabled.
>
>Here's the code in the OK button:
>
>
>ThisForm.Hide()
>IF ThisForm.Process()
>	ThisForm.Release()
>ELSE
>	ThisForm.Show()
>ENDIF 
>
>
>The Process method is the one that involves the wait state. The code in Process is way too tied into this app to bother posting here, but the wait state code involves a loop checking a flag and has inside it DOEVENTS and WAIT WINDOW ... TIMEOUT.
>
>This appears to be some kind of timing issue because if I step through the code, the menu bars become enabled again.
>
>Looking for any clues as to how to resolve this.
>
>Tamar

A bunch of SWAGs, don't know how many you've already tried:

1. Check Process() for anything that may not be cleaning up after itself e.g. dangling references, any SETs or other environment configuration items that are getting changed/stomped on unexpectedly

2. Put a DOEVENTS immediately before ThisForm.Release in your code above

3. Try a SleepAPI call immediately before ThisForm.Release in your code above

4. Move the Process() call out of the IF... structure e.g.
ThisForm.Hide()
llResult = ThisForm.Process()
IF llResult
	ThisForm.Release()
ELSE
	ThisForm.Show()
ENDIF 
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform