msuresh1977
09-08-2003, 06:16 AM
How to pass data from one exe to another exe?
say for eg a person has opened an exe called 1.exe from system 1.
if another person opens the same exe(1.exe) in another system.is it possible that person 2 can communicate with person 1 thru the exe.
what provision that exe should have?
what is the difference between an global variable and public variable?
Chris J Locke
09-08-2003, 06:41 AM
If its only a small bit of data, then using files is a simple easy method. Write data to "someText.txt" for example, which the other program can open. The drawback is that only one program can write to the file at any one time. You could write to multiple files (1.txt, then 2.txt, then 3.txt) but it then gets a bit messy. Quick n dirty though.
The most common method (but fiddly) is using the winsock control and creating a connection between the two. Check out www.winsockvb.com which provides good examples.
As for variable types, a global variable can be seen by every procedure, while a local variable can only be seen by the procedure it was created in. For example, drop 2 command buttons on a form. In one, if you type 'Dim myString as string' into the click event, this wouldn't be seen / be available from the other command button's click event.
Thinker
09-08-2003, 10:00 AM
The most common method (but fiddly) is using the winsock control and creating a connection between the two.
Only the most common among people who don't understand how to do it
correctly. And this will fail if networking isn't installed (granted in this
internet age a rare thing).
This thread has an ActiveX/COM method and a link to an API method to
do Interprocess Communications.
http://www.visualbasicforum.com/showthread.php?threadid=20274