Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Menu bars disabled--redux
Message
De
24/11/2009 08:28:20
 
 
À
21/11/2009 03:51:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01435795
Message ID:
01436301
Vues:
77
>>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

I've used a breakpoint to confirm that the form in question has closed, so I don't think it's a dangling reference.

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

Good thought. This app is full of DOEVENTS, but one more shouldn't hurt.

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

I think I tried some other kind of wait state after releasing the form, but I'll fiddle with those ideas.

>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 
>
Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform