Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word GetObject() - WHACKED?????
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00538237
Message ID:
00539097
Views:
10
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform