Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word GetObject() - WHACKED?????
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00538237
Message ID:
00539097
Vues:
9
>George,
> I didn't know if he had WSH installed on all machines. That is typically what I do, but what is the call to make the VFP wait for the called program to finish? Here is a typical function I would use, what do you change to make it wait?
>
>
>=lNetSend( GETFILE( ) )
>
>FUNCTION lNetSend
>  PARAMETERS tcOpenMe
>
>  oShell = CREATEOBJECT( 'WScript.Shell' )
>  oShell.Run( tcOpenMe )
>  oShell = .NULL.
>  RELEASE oShell
>
>ENDFUNC
>
John,

The Run method supports 3 parameters. The first, of course, is either the executable or document to be run. The second is the window type. The value, I believe, correspond to the same ones that ShellExecute supports. It is optional. The third, is a logical (also optional) value as to whether or not to wait for the executable to terminate. The code below, similar to your work above (with some modification), demonstrates this.
lcfile = GETFILE("*")
IF NOT EMPTY(lcfile)
  oShell = CREATEOBJECT("WScript.Shell")
  * Open the file in the associated application
  * with its window restored to its last size 
  * and position and wait for it to terminate
  oShell.Run(lcfIle, 4, .T.)
  oShell = NULL
ENDIF
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform