Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Having problem to start two process separately
Message
From
01/02/2000 12:39:44
 
 
To
01/02/2000 12:23:39
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00325561
Message ID:
00325677
Views:
26
>re: two command buttons launch two sub-routines
>
>As Ed mentioned, recoordinating two RUNning processes would be difficult.
>
>If these buttons launch routines that can run without user intervention and then terminate (ie: gather/report function) Or if the buttons are spawning completely self-contained programs (It would appear to be an MDI not contained in the parent window) You could easily use run.
>
>Button1.click: !/N2 Sub1.exe **gathers data1 & spools report
>Button2.click: !/N2 Sub2.exe **gathers data2 & spools report
>
>(/N2 = nowait active and minimized, see "HELP RUN")

Coordinating multiple VFP sessions is doable though - you need to plan ahead to let the separate instances pass messages and check each other's states conveniently. A shared table, where each session registers itself and posts its current state, is an easy mechanism to start with, since it uses native VFP structures and commands, and works well both locally and remotely. COM servers are another approach. And MSMQ is an option as well. Other API-based solutions that allow for very intimiate control are available, too, Christof Lange, the author of STRUCT, a library that makes many of the things in the Win32 API easier to use by letting VFP build and decompose C structures, mentioned that he's done some MUTEX using STRUCT and the API a few months back.

The key issue is picking a mechanism beforehand, and understanding the messaging and coordiantion required to perform synchronization.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform