Qbasicnews.com

Full Version: How can i make two applications communicate ??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want a way so two applications communicate each other...
The only thing that comes to mind right now would be using files.

Psuedocode:
Code:
A: Writes Pie to file
B: Reads file and sees Pie, then writes 42 to file
A: Sees the 42. ect
How can this happen at real time??

Anonymous

it woudlnt, it would be done in steps

step 1: write to external file.
step 2: pass execution to prog2
step 3: prog2 reads the file, writes its output
step 4: pass execution back to mainprog

er... why are you doing this btw
I think he means some way of multithreading. Sorry dude, not with QB Wink
Two DOS programs can't run at the same time in a single DOS environment. DOS was made like this...
If you plan to run two programs sequentially in the same DOS box, the CHAIN instruction can be set to preserve variables.

You can have two DOS boxes running at the same time in Windows. There are many ways in wich windows processes can communicate but those can't be accessed from the dos programs, unless you use a slave Windows program to do it. You could use dsock (a library allowing QB to access the TCP-IP services of Windows) to connect "live" the two programs.