Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One VFP exe calling another VFP exe
Message
De
06/01/2010 15:39:43
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01442401
Message ID:
01442490
Vues:
84
>Hi Gang!
>
>I have 2 VFP exe's on this PC (call them VFP_a and VFP_b).
>
>They both are up and running. VFP_b is minimized to the taskbar. VFP_b had a timer running that is watching a table called "POS" for any new records to show up in it for processing, to be put into another table.
>
>When the records from VFP_a show up in "POS", the VFP_b sees them (through the timer) and restores on the screen to its normal size and processes the "POS" records, then ZAPs the "POS" table to restart again.
>
>What we would like for the VFP_a to do now, is to
>
>a) check to see if VFP_b is actually executting...
>
>b) press a "RESET" button on the VFP_b form....
>
>c) minimize the VFP_b executable when done to put it back on the taskbar.
>
>I am not allowed to modify VFP_b in any way, because the source code for that is now controlled in another developement house and location.

Assuming Naomi's response takes care of a):

b) I'm guessing that a "Reset" button in VFP_b can't be pressed while it's processing POS records. Or rather, maybe it can (and the keystroke will be buffered) but it's not always a good idea to do that. So, you may have to wait until it's finished processing (i.e. step c)). I haven't used it, but I think there's a SendKeys API function you can use to send keystrokes to another app as long as you can get a Windows handle to that app: http://www.foxite.com/archives/send-keystrokes-to-external-app-from-vfp-0000229059.htm

c) Waiting for VFP_b to finish implies you need to set up a timer in your own app VFP_a and periodically check for some evidence that the other one has finished e.g. that the table has been ZAPped. I think there may be another API call that lets you change the minimized/maximized status of running apps, you could use that for this final step.

You may not be able to change VFP_b, but if you are allowed to *invoke* VFP_b from within VFP_a (via ShellExecute, Ed Rauh's API_AppRun etc.) rather than on its own, that might make communicating with it easier.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform