Q: How do I send a variable from one executable to another? I need to send a message from one executable to another.  


*

*Executable #1 (my main program -- always running) needs to send a string variable and run Executable #2 (Executable #1 will wait until Executable #2 has sent a string back). 

*Executable #2 will use this string to complete a task. 

*Once the task is complete, Executable #2 will send Executable #1 the result (a string).

*Executable #2 will end itself once completed.  


I have searched the web for solutions and have had no luck.

A: There are several ways of doing IPC (inter process communication), but the simplest way might simply be a shared file. Executable #2 will periodically poll to see if there is anything in the file. Executable #1 will write the string to that file when ready.
This method is very simple and in fact, used very successfully for integration between trading systems in the financial industry.
You can even have simple TCP/IP communication between the processes but that would be more work. If you're on Linux, you can use named pipes as well.

A: Try using named pipes for an example click this link How to: Use Named Pipes to Communicate Between Processes over a Network this can also work for processes running on the same desktop.
