Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WORD automation busy signal??
Message
De
12/01/2001 12:13:44
 
 
À
12/01/2001 11:09:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00462984
Message ID:
00463044
Vues:
15
Hi John,
Very COOOL..
How did you think of that? It worked on the form that I automate WORD from. I did not get a busy signal and all works great. I do need to add a fly to the ointment now. I have 2 other areas in my app that automate WORD. The thisform.Gotfocus() test is a little tricky since when WORD returns I'm a little uncertain as to what actually has focus. You see, I have one situation where a toolbar calls a method on the activeform that contians the killer loop. I also have another situation where a container object that has the method code with the killer loop is called from a toolbar button that activates a click of a button on the container that resides on a page of a page frame. I need to work around this for a while.

ANY thoughts??
Thanx
Neil


>Hi Neil,
>
>I think that INKEY() loop is messing you up. You are constantly querying a Word property while the user is doing stuff that may involve a modal screen in Word. So when VFP goes to query that property again, Word is literally busy and/or doesn't have access to that property.
>
>Get rid of the loop. You may possibly try your test to see if Word has been closed in the GotFocus of the Form it's launched from...on the idea that if they closed Word and switched back to the VFP app and the Form, GotFocus will fire.
>
>>I allow my users to use WORD via automation in one of my apps. I instantiate WORD, via oo = createobj("word.application"), and then make it visible to the user. The user has full access to all of WORD'S features. While the user is in WORD I loop, in a kind of wait state, so that WORD stays on the DeskTop until the user QUITS WORD. That works fine but yesterday someone revealed a problem. If the user opens a modal dialog while in WORD and stays in it for approx. 20 seconds, while I am looping, vfp has an error dialog waiting for you indicating that the automation server is busy. I guess that is really accurate. WORD is actually very busy in the modal dialog and can't take any commands at the moment. BUT, I am just looping within vfp and just want to know when the user QUITS WORD.
>>
>>ANY THOUGHTS??
>>
>>
>>***
>>It is something with how vfp and automation work. VFP thinks that the automation server is **BUSY** whenever a modal dialog is able to stay on the screen for approx. 20 seconds.
>>Try this:
>>
>>** create WORD server
>>oo = createobject("word.application")
>>oo.visible = .t.
>>** maximize WORD
>>oo.windowstate = 1
>>
>>** When Word comes up on the DeskTop Try This:
>>** click on TOOLS, CUSTOMIZE. Keep the Customize dialog on the screen for
>>** 20 seconds. Minimize WORD and look at the error waiting for you in vfp.
>>** In Fact, this will happen if you open any modal dialog in WORD and stick around for 20 seconds.
>>** I have simulated this error directly from the Command Window. Simply type
>>** oo = createobj("word.application") in the command window. Control WORD via the
>>** oo reference. Activate a WORD modal dialog and then try to use the oo referencce
>>** in the command window. You get the same error. ANY THOUGHTS??
>>
>>** create wait state to keep WORD on DeskTop
>>** without this, the "do returnme" would fire before user closed word
>>do while type("oo.displayrecentfiles")# "U" && works only in word 2000
>> = inkey(.5)
>>enddo
>>do returnme
>>messagebox("You closed WORD")
>>oo = .null.
>>release oo
>>messagebox("Automation Reference Is Gone")
>>
>>procedure returnme
>>messagebox("You are in Procedure: Returnme")
>>
>>Thanx
>>Dr. G. (Neil)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform